16 FOREACH(Monsters, it != MON_Null && it.m_model.model_str() == this.
model, {
21 if(!monster_id) {
return false; }
23 monster_id.mr_anim(monster_id,
this);
27 this.anim_duckjump = animfixfps(
this,
'5 1 10', none);
28 this.anim_duckidle = this.anim_idle;
29 this.anim_jump = animfixfps(
this,
'8 1 10', none);
30 this.anim_taunt = animfixfps(
this,
'12 1 0.33', none);
31 this.anim_runbackwards = this.anim_run;
32 this.anim_strafeleft = this.anim_run;
33 this.anim_straferight = this.anim_run;
34 this.anim_forwardright = this.anim_run;
35 this.anim_forwardleft = this.anim_run;
36 this.anim_backright = this.anim_run;
37 this.anim_backleft = this.anim_run;
38 this.anim_duckwalkbackwards = this.
anim_walk;
39 this.anim_duckwalkstrafeleft = this.
anim_walk;
40 this.anim_duckwalkstraferight = this.
anim_walk;
41 this.anim_duckwalkforwardright = this.
anim_walk;
42 this.anim_duckwalkforwardleft = this.
anim_walk;
43 this.anim_duckwalkbackright = this.
anim_walk;
44 this.anim_duckwalkbackleft = this.
anim_walk;
47 this.anim_shoot_z = 0.001;
48 this.anim_melee_z = 0.001;
55 int mdlidx = e.modelindex;
56 if (mdlidx == e.animdecide_modelindex)
return;
57 e.animdecide_modelindex = mdlidx;
59 if(
substring(e.model, 0, 16) ==
"models/monsters/")
65 #define ANIM_VEC(a, frames, rate) anim_vec(ANIM_##a, mdlidx, frames, rate) 68 e.anim_die1 = animfixfps(e,
ANIM_VEC(die1, 1, 0.5), none);
69 e.anim_die2 = animfixfps(e,
ANIM_VEC(die2, 1, 0.5), none);
70 e.anim_draw = animfixfps(e,
ANIM_VEC(draw, 1, 3), none);
71 e.anim_duckwalk = animfixfps(e,
ANIM_VEC(duckwalk, 1, 1), none);
72 e.anim_duckjump = animfixfps(e,
ANIM_VEC(duckjump, 1, 10), none);
73 e.anim_duckidle = animfixfps(e,
ANIM_VEC(duckidle, 1, 1), none);
74 e.anim_idle = animfixfps(e,
ANIM_VEC(idle, 1, 1), none);
75 e.anim_jump = animfixfps(e,
ANIM_VEC(jump, 1, 10), none);
76 e.anim_pain1 = animfixfps(e,
ANIM_VEC(pain1, 1, 2), none);
77 e.anim_pain2 = animfixfps(e,
ANIM_VEC(pain2, 1, 2), none);
78 e.anim_shoot = animfixfps(e,
ANIM_VEC(shoot, 1, 5), none);
79 e.anim_taunt = animfixfps(e,
ANIM_VEC(taunt, 1, 0.33), none);
80 e.anim_run = animfixfps(e,
ANIM_VEC(run, 1, 1), none);
81 e.anim_runbackwards = animfixfps(e,
ANIM_VEC(runbackwards, 1, 1), none);
82 e.anim_strafeleft = animfixfps(e,
ANIM_VEC(strafeleft, 1, 1), none);
83 e.anim_straferight = animfixfps(e,
ANIM_VEC(straferight, 1, 1), none);
84 e.anim_forwardright = animfixfps(e,
ANIM_VEC(forwardright, 1, 1),
ANIM_VEC(straferight, 1, 1));
85 e.anim_forwardleft = animfixfps(e,
ANIM_VEC(forwardleft, 1, 1),
ANIM_VEC(strafeleft, 1, 1));
86 e.anim_backright = animfixfps(e,
ANIM_VEC(backright, 1, 1),
ANIM_VEC(straferight, 1, 1));
87 e.anim_backleft = animfixfps(e,
ANIM_VEC(backleft , 1, 1),
ANIM_VEC(strafeleft, 1, 1));
89 e.anim_duckwalkbackwards = animfixfps(e,
ANIM_VEC(duckwalkbackwards, 1, 1),
ANIM_VEC(duckwalk, 1, 1));
90 e.anim_duckwalkstrafeleft = animfixfps(e,
ANIM_VEC(duckwalkstrafeleft, 1, 1),
ANIM_VEC(duckwalk, 1, 1));
91 e.anim_duckwalkstraferight = animfixfps(e,
ANIM_VEC(duckwalkstraferight, 1, 1),
ANIM_VEC(duckwalk, 1, 1));
92 e.anim_duckwalkforwardright = animfixfps(e,
ANIM_VEC(duckwalkforwardright, 1, 1),
ANIM_VEC(duckwalk, 1, 1));
93 e.anim_duckwalkforwardleft = animfixfps(e,
ANIM_VEC(duckwalkforwardleft, 1, 1),
ANIM_VEC(duckwalk, 1, 1));
94 e.anim_duckwalkbackright = animfixfps(e,
ANIM_VEC(duckwalkbackright, 1, 1),
ANIM_VEC(duckwalk, 1, 1));
95 e.anim_duckwalkbackleft = animfixfps(e,
ANIM_VEC(duckwalkbackleft , 1, 1),
ANIM_VEC(duckwalk, 1, 1));
100 e.anim_shoot_z = 0.001;
101 e.anim_melee_z = 0.001;
120 vector outframe =
'-1 0 0';
122 if(e.anim_upper_time >= e.anim_upper_implicit_time)
124 a = e.anim_upper_action;
125 t = e.anim_upper_time;
129 a = e.anim_upper_implicit_action;
130 t = e.anim_upper_implicit_time;
143 if(
time <= t + outframe.y / outframe.z)
150 t =
max(e.anim_time, e.anim_implicit_time);
168 vector outframe =
'-1 0 0';
170 if(e.anim_lower_time >= e.anim_lower_implicit_time)
172 a = e.anim_lower_action;
173 t = e.anim_lower_time;
177 a = e.anim_lower_implicit_action;
178 t = e.anim_lower_implicit_time;
186 if(
time <= t + outframe.y / outframe.z)
193 t =
max(e.anim_time, e.anim_implicit_time);
270 if(v.x >
fabs(v.y) * 0.5)
272 if(v.x < -
fabs(v.y) * 0.5)
274 if(v.y >
fabs(v.x) * 0.5)
276 if(v.y < -
fabs(v.x) * 0.5)
287 e.anim_lower_implicit_time =
time;
290 if(s != e.anim_implicit_state)
292 e.anim_implicit_state = s;
293 e.anim_implicit_time =
time;
296 void animdecide_setframes(
entity e,
float support_blending, .
float fld_frame, .
float fld_frame1time, .
float fld_frame2, .
float fld_frame2time)
306 if(upper.z && !lower.z)
308 else if(lower.z && !upper.z)
310 if(e.frame1time != upper.y || e.frame2time != lower.y)
312 e.(fld_frame) = upper.x;
313 e.(fld_frame1time) = upper.y;
314 e.(fld_frame2) = lower.x;
315 e.(fld_frame2time) = lower.y;
319 if(upper.z > lower.z)
321 else if(lower.z > upper.z)
323 if(e.frame1time != upper.y)
325 e.(fld_frame) = upper.x;
326 e.(fld_frame1time) = upper.y;
333 if(newstate == e.anim_state)
335 e.anim_state = newstate;
343 if(action == e.anim_lower_action)
345 e.anim_lower_action = action;
346 e.anim_lower_time =
time;
351 if(action == e.anim_upper_action)
353 e.anim_upper_action = action;
354 e.anim_upper_time =
time;
const int ANIMIMPLICITSTATE_BACKWARDS
const int ANIMSTATE_FROZEN
void animdecide_setframes(entity e, float support_blending,.float fld_frame,.float fld_frame1time,.float fld_frame2,.float fld_frame2time)
void animdecide_setstate(entity e, int newstate, float restart)
bool monsters_animoverride(entity this)
const int ANIMACTION_JUMP
void animdecide_load_if_needed(entity e)
const int EF_RESTARTANIM_BIT
const int ANIMACTION_PAIN2
const float ANIMPRIO_CROUCH
const int ANIMSTATE_FOLLOW
const int ANIMIMPLICITSTATE_FORWARD
const int ANIMIMPLICITSTATE_LEFT
void animdecide_setimplicitstate(entity e, float onground)
void animdecide_setaction(entity e, float action, float restart)
const int ANIMIMPLICITSTATE_RIGHT
const float ANIMPRIO_DEAD
const float ANIMPRIO_IDLE
#define ANIM_VEC(a, frames, rate)
const int ANIMACTION_SHOOT
const int ANIMACTION_PAIN1
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const float ANIMPRIO_ACTIVE
const int ANIMACTION_DRAW
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
const int ANIMIMPLICITSTATE_INAIR
const int ANIMACTION_TAUNT
const int ANIMSTATE_DEAD2
const int ANIMSTATE_DEAD1
vector animdecide_getupperanim(entity e)
const int ANIMACTION_MELEE
vector animdecide_getloweranim(entity e)
#define BITXOR_ASSIGN(a, b)
#define FOREACH(list, cond, body)