void Monsters_Precache()
{
float i;
- for(i = MONSTER_FIRST; i <= MONSTER_LAST; ++i)
+ for(i = MONSTER_FIRST + 1; i < MONSTER_LAST; ++i)
monster_precache(i);
}
.float candrop;
+.float spawn_time; // stop monster from moving around right after spawning
+
.string oldtarget2;
.float lastshielded;
const float MONSTERSKILL_NOTINSANE = 2048; // monster will not spawn on skill 5
const float MONSTERSKILL_NOTNIGHTMARE = 4096; // monster will not spawn on skill >= 6
+// legacy flags
const float MONSTERFLAG_NORESPAWN = 2;
const float MONSTERFLAG_MINIBOSS = 64; // monster spawns as mini-boss (also has a chance of naturally becoming one)
const float MONSTERFLAG_NOWANDER = 128; // disable wandering around (currently unused)
}
}
- if(gameover || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start))
+ if(gameover || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < self.spawn_time)
{
runspeed = walkspeed = 0;
- monsters_setframe(manim_idle);
+ if(time >= self.spawn_time)
+ monsters_setframe(manim_idle);
movelib_beak_simple(stopspeed);
self.SendFlags |= MSF_MOVE;
return;
self.oldtarget2 = self.target2;
self.deadflag = DEAD_NO; // UNDEAD
self.noalign = nodrop;
+ self.spawn_time = time;
self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
if not(self.ticrate)
self.checkattack = GenericCheckAttack;
self.attack_melee = ogre_melee;
self.attack_ranged = ogre_missile;
- self.nextthink = time + 0.1;
+ self.nextthink = time + random() * 0.5 + 0.1;
self.think = ogre_think;
self.weapon = WEP_GRENADE_LAUNCHER;
self.health = autocvar_g_monster_zombie_health * self.scale;
self.classname = "monster_zombie";
- self.nextthink = time + 2.1;
+ self.spawn_time = time + 2.1;
+ self.nextthink = time + random() * 0.5 + 0.1;
self.think = zombie_think;
self.checkattack = GenericCheckAttack;
self.attack_melee = zombie_attack_standing;