precache_all_playermodels("models/player/*.iqm");
}
+ Monsters_Precache();
Projectile_Precache();
Hook_Precache();
GibSplash_Precache();
void monster_precache(float _mid)
{
monster_mid2info(_mid);
- if(turret_is_precache[_mid])
+ if(monster_precached[_mid])
return;
switch(_mid)
monster_precached[_mid] = TRUE;
}
+void Monsters_Precache()
+{
+ float i;
+ for(i = MONSTER_FIRST; i <= MONSTER_LAST; ++i)
+ monster_precache(i);
+}
+
void monster_mid2info(float _mid)
{
switch(_mid)
void ent_monster();
+void Monsters_Precache();
}
float monster_initialize(string net_name, float mon_id,
- string bodymodel,
vector min_s,
vector max_s,
float nodrop,
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; }
- if(self.model == "" || self.model == "null")
- if(bodymodel == "")
- error("monsters: missing bodymodel!");
-
if(self.netname == "")
{
if(net_name != "" && IS_PLAYER(self.realowner))
if(self.spawnflags & MONSTERFLAG_GIANT && !autocvar_g_monsters_nogiants)
self.scale = 5;
-
if(self.team && !teamplay)
self.team = 0;
self.flags = FL_MONSTER;
-
- if(self.model && self.model != "null")
- bodymodel = self.model; // TODO: find out why monsters can become invisible
if not(self.spawnflags & MONSTERFLAG_SPAWNED) // naturally spawned monster
if not(self.monster_respawned)
monsters_total += 1;
-
- precache_model(bodymodel);
- setmodel(self, bodymodel);
ScaleMonster(self.scale, min_s, max_s);
self.takedamage = DAMAGE_AIM;
if not (monster_initialize(
"Fiend", MONSTER_DEMON,
- DEMON_MODEL,
DEMON_MIN, DEMON_MAX,
FALSE,
demon_die, demon_spawn))
if not (monster_initialize(
"Cerberus", MONSTER_DOG,
- DOG_MODEL,
DOG_MIN, DOG_MAX,
FALSE,
dog_die, dog_spawn))
self.attack_ranged = enforcer_attack;
self.view_ofs *= 0.5;
+ monsters_setframe(enforcer_anim_stop);
+
+ setmodel(self, ENFORCER_MODEL); // for weapon entity
+
self.weaponentity = spawn();
self.weaponentity.owner = self;
self.weaponentity.team = self.team;
if(Monster_CheckAppearFlags(self))
return;
+
+ precache_model("models/turrets/ewheel-gun1.md3");
+ precache_model(ENFORCER_MODEL);
if not (monster_initialize(
"Enforcer", MONSTER_ENFORCER,
- ENFORCER_MODEL,
ENFORCER_MIN, ENFORCER_MAX,
FALSE,
enforcer_die, enforcer_spawn))
if not (monster_initialize(
"Rotfish", MONSTER_FISH,
- FISH_MODEL,
FISH_MIN, FISH_MAX,
TRUE,
fish_die, fish_spawn))
if not (monster_initialize(
"Hell-knight", MONSTER_HELLKNIGHT,
- HELLKNIGHT_MODEL,
HELLKNIGHT_MIN, HELLKNIGHT_MAX,
FALSE,
hellknight_die, hellknight_spawn))
if not (monster_initialize(
"Knight", MONSTER_KNIGHT,
- KNIGHT_MODEL,
KNIGHT_MIN, KNIGHT_MAX,
FALSE,
knight_die, knight_spawn))
if not (monster_initialize(
"Ogre", MONSTER_OGRE,
- OGRE_MODEL,
OGRE_MIN, OGRE_MAX,
FALSE,
ogre_die, ogre_spawn))
if not (monster_initialize(
"Mage", MONSTER_MAGE,
- SHALRATH_MODEL,
SHALRATH_MIN, SHALRATH_MAX,
FALSE,
shalrath_die, shalrath_spawn))
if not (monster_initialize(
"Shambler", MONSTER_SHAMBLER,
- SHAMBLER_MODEL,
SHAMBLER_MIN, SHAMBLER_MAX,
FALSE,
shambler_die, shambler_spawn))
monsters_setframe(soldier_anim_draw);
+ setmodel(self, SOLDIER_MODEL);
+
RandomSelection_Init();
RandomSelection_Add(world, WEP_LASER, string_null, autocvar_g_monster_soldier_weapon_laser_chance, 1);
RandomSelection_Add(world, WEP_SHOTGUN, string_null, autocvar_g_monster_soldier_weapon_shotgun_chance, 1);
if(Monster_CheckAppearFlags(self))
return;
+
+ precache_model("models/weapons/v_seeker.md3");
+ precache_model(SOLDIER_MODEL);
if not (monster_initialize(
- "Grunt", MONSTER_MARINE,
- SOLDIER_MODEL,
+ "Marine", MONSTER_MARINE,
SOLDIER_MIN, SOLDIER_MAX,
FALSE,
soldier_die, soldier_spawn))
if not (monster_initialize(
"Spider", MONSTER_SPIDER,
- SPIDER_MODEL,
SPIDER_MIN, SPIDER_MAX,
FALSE,
spider_die, spider_spawn))
if not (monster_initialize(
"Spawn", MONSTER_TARBABY,
- TARBABY_MODEL,
TARBABY_MIN, TARBABY_MAX,
FALSE,
tarbaby_die, tarbaby_spawn))
if not (monster_initialize(
"Scrag", MONSTER_SCRAG,
- WIZARD_MODEL,
WIZARD_MIN, WIZARD_MAX,
TRUE,
wizard_die, wizard_spawn))
if not (monster_initialize(
"Zombie", MONSTER_ZOMBIE,
- ZOMBIE_MODEL,
ZOMBIE_MIN, ZOMBIE_MAX,
FALSE,
zombie_die, zombie_spawn))