+#ifndef ZOMBIE_H
+#define ZOMBIE_H
+
+#ifndef MENUQC
+MODEL(MON_ZOMBIE, M_Model("zombie.dpm"));
+#endif
+
CLASS(Zombie, Monster)
ATTRIB(Zombie, spawnflags, int, MON_FLAG_MELEE | MON_FLAG_RIDE);
ATTRIB(Zombie, mins, vector, '-18 -18 -25');
ATTRIB(Zombie, maxs, vector, '18 18 47');
- ATTRIB(Zombie, mdl, string, "zombie.dpm");
- ATTRIB(Zombie, model, string, strzone(strcat("models/monsters/", this.mdl)));
+#ifndef MENUQC
+ ATTRIB(Zombie, m_model, Model, MDL_MON_ZOMBIE);
+#endif
ATTRIB(Zombie, netname, string, "zombie");
ATTRIB(Zombie, monster_name, string, _("Zombie"));
ENDCLASS(Zombie)
REGISTER_MONSTER(ZOMBIE, NEW(Zombie)) {
#ifndef MENUQC
- MON_ACTION(this, MR_PRECACHE);
+ this.mr_precache(this);
#endif
}
+#endif
+
+#ifdef IMPLEMENTATION
+
#ifdef SVQC
float autocvar_g_monster_zombie_health;
float autocvar_g_monster_zombie_damageforcescale = 0.55;
const float zombie_anim_spawn = 30;
*/
+.vector moveto;
+
void M_Zombie_Attack_Leap_Touch()
{SELFPARAM();
if (self.health <= 0)
{
angles_face = vectoangles(self.moveto - self.origin);
angles_face = normalize(angles_face) * (autocvar_g_monster_zombie_attack_leap_force);
- Damage(other, self, self, (autocvar_g_monster_zombie_attack_leap_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_ZOMBIE_JUMP, other.origin, angles_face);
+ Damage(other, self, self, (autocvar_g_monster_zombie_attack_leap_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_ZOMBIE_JUMP.m_id, other.origin, angles_face);
self.touch = Monster_Touch; // instantly turn it off to stop damage spam
self.state = 0;
}
{SELFPARAM();
self.armorvalue = 0.9;
self.state = MONSTER_ATTACK_MELEE; // freeze monster
- self.attack_finished_single = time + 2.1;
- self.anim_finished = self.attack_finished_single;
+ self.attack_finished_single[0] = time + 2.1;
+ self.anim_finished = self.attack_finished_single[0];
setanim(self, self.anim_blockstart, false, true, true);
Monster_Delay(1, 0, 2, M_Zombie_Defend_Block_End);
return true;
}
-float M_Zombie_Attack(float attack_type)
+float M_Zombie_Attack(float attack_type, entity targ)
{SELFPARAM();
switch(attack_type)
{
else
chosen_anim = self.anim_melee3;
- return Monster_Attack_Melee(self.enemy, (autocvar_g_monster_zombie_attack_melee_damage), chosen_anim, self.attack_range, (autocvar_g_monster_zombie_attack_melee_delay), DEATH_MONSTER_ZOMBIE_MELEE, true);
+ return Monster_Attack_Melee(self.enemy, (autocvar_g_monster_zombie_attack_melee_damage), chosen_anim, self.attack_range, (autocvar_g_monster_zombie_attack_melee_delay), DEATH_MONSTER_ZOMBIE_MELEE.m_id, true);
}
case MONSTER_ATTACK_RANGED:
{
return false;
}
-void spawnfunc_monster_zombie() { Monster_Spawn(MON_ZOMBIE.monsterid); }
+spawnfunc(monster_zombie) { Monster_Spawn(MON_ZOMBIE.monsterid); }
#endif // SVQC
#ifdef SVQC
return true;
}
#endif
+
+#endif