void Monster_Sounds_Precache()
{SELFPARAM();
- string m = (get_monsterinfo(self.monsterid)).model;
+ string m = (get_monsterinfo(self.monsterid)).m_model.model_str();
float globhandle, n, i;
string f;
if(targ_vlen <= e.attack_range)
{
- float attack_success = e.monster_attackfunc(MONSTER_ATTACK_MELEE);
+ float attack_success = e.monster_attackfunc(MONSTER_ATTACK_MELEE, targ);
if(attack_success == 1)
Monster_Sound(monstersound_melee, 0, false, CH_VOICE);
else if(attack_success > 0)
if(targ_vlen > e.attack_range)
{
- float attack_success = e.monster_attackfunc(MONSTER_ATTACK_RANGED);
+ float attack_success = e.monster_attackfunc(MONSTER_ATTACK_RANGED, targ);
if(attack_success == 1)
Monster_Sound(monstersound_melee, 0, false, CH_VOICE);
else if(attack_success > 0)
self.anim_die2 = animfixfps(self, '9 1 0.01', '0 0 0');*/
// then get the real values
- MON_ACTION(self.monsterid, MR_ANIM);
+ Monster mon = get_monsterinfo(self.monsterid);
+ mon.mr_anim(mon);
}
void Monster_Touch()
CSQCModel_UnlinkEntity(self);
- MON_ACTION(self.monsterid, MR_DEATH);
+ Monster mon = get_monsterinfo(self.monsterid);
+ mon.mr_death(mon);
if(self.candrop && self.weapon)
W_ThrowNewWeapon(self, self.weapon, 0, self.origin, randomvec() * 150 + '0 0 325');
damage_take = take;
frag_attacker = attacker;
frag_deathtype = deathtype;
- MON_ACTION(self.monsterid, MR_PAIN);
+ Monster mon = get_monsterinfo(self.monsterid);
+ mon.mr_pain(mon);
take = damage_take;
if(take)
return;
}
- if(MON_ACTION(self.monsterid, MR_THINK))
+ Monster mon = get_monsterinfo(self.monsterid);
+ if(mon.mr_think(mon))
Monster_Move(self.speed2, self.speed, self.stopspeed);
Monster_Anim();
float Monster_Spawn_Setup()
{SELFPARAM();
- MON_ACTION(self.monsterid, MR_SETUP);
+ Monster mon = get_monsterinfo(self.monsterid);
+ mon.mr_setup(mon);
// ensure some basic needs are met
if(!self.health) { self.health = 100; }
if(!autocvar_g_monsters) { Monster_Remove(self); return false; }
- self.mdl = mon.model;
if(Monster_Appear_Check(self, mon_id)) { return true; } // return true so the monster isn't removed
if(!self.monster_skill)
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED)) // don't count re-spawning monsters either
monsters_total += 1;
- _setmodel(self, self.mdl);
+ setmodel(self, mon.m_model);
self.flags = FL_MONSTER;
self.classname = "monster";
self.takedamage = DAMAGE_AIM;