set g_monsters_score_kill 1
set g_monsters_max 20
set g_monsters_max_perplayer 0
-set g_monsters_skill_easy 2
-set g_monsters_skill_normal 4
-set g_monsters_skill_hard 5
-set g_monsters_skill_insane 7
-set g_monsters_skill_nightmare 10
// }}}
if(self.msound_sight == "") self.msound_sight = strzone(strcat("monsters/", mon, "_sight.wav"));
}
+void monster_makevectors(entity e)
+{
+ vector v;
+
+ v = CENTER_OR_VIEWOFS(e);
+ self.v_angle = vectoangles(v - (self.origin + self.view_ofs));
+ self.v_angle_x = -self.v_angle_x;
+
+ makevectors(self.v_angle);
+}
+
float monster_melee(entity targ, float damg, float er, float deathtype, float dostop)
{
float rdmg = damg * random();
self.SendFlags |= MSF_MOVE;
}
- makevectors (self.angles);
+ monster_makevectors(targ);
traceline(self.origin + self.view_ofs, self.origin + v_forward * er, 0, self);
}
}
-void monster_makevectors(entity e)
-{
- vector v;
-
- v = CENTER_OR_VIEWOFS(e);
- self.v_angle = vectoangles(v - (self.origin + self.view_ofs));
- self.v_angle_x = -self.v_angle_x;
-
- makevectors(self.v_angle);
-}
-
void monster_use ()
{
if (self.enemy)
entity mon = get_monsterinfo(mon_id);
// support for quake style removing monsters based on skill
- if(monster_skill <= autocvar_g_monsters_skill_easy && (self.spawnflags & MONSTERSKILL_NOTEASY)) { return FALSE; }
- if(monster_skill == autocvar_g_monsters_skill_normal && (self.spawnflags & MONSTERSKILL_NOTMEDIUM)) { return FALSE; }
- if(monster_skill == autocvar_g_monsters_skill_hard && (self.spawnflags & MONSTERSKILL_NOTHARD)) { return FALSE; }
- if(monster_skill == autocvar_g_monsters_skill_insane && (self.spawnflags & MONSTERSKILL_NOTINSANE)) { return FALSE; }
- if(monster_skill >= autocvar_g_monsters_skill_nightmare && (self.spawnflags & MONSTERSKILL_NOTNIGHTMARE)) { return FALSE; }
+ switch(monster_skill)
+ {
+ case 1: if(self.spawnflags & MONSTERSKILL_NOTEASY) return FALSE; break;
+ case 2: if(self.spawnflags & MONSTERSKILL_NOTMEDIUM) return FALSE; break;
+ case 3: if(self.spawnflags & MONSTERSKILL_NOTHARD) return FALSE; break;
+ case 4: if(self.spawnflags & MONSTERSKILL_NOTINSANE) return FALSE; break;
+ case 5: if(self.spawnflags & MONSTERSKILL_NOTNIGHTMARE) return FALSE; break;
+ }
if(self.monster_name == "")
self.monster_name = M_NAME(mon_id);
float autocvar_g_monsters_healthbars;
float autocvar_g_monsters_respawn_delay;
float autocvar_g_monsters_respawn;
-float autocvar_g_monsters_skill_easy;
-float autocvar_g_monsters_skill_normal;
-float autocvar_g_monsters_skill_hard;
-float autocvar_g_monsters_skill_insane;
-float autocvar_g_monsters_skill_nightmare;
float autocvar_g_touchexplode_radius;
float autocvar_g_touchexplode_damage;
float autocvar_g_touchexplode_edgedamage;