]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Update zombie status while spawning
authorMario <mario.mario@y7mail.com>
Mon, 22 Apr 2013 11:37:31 +0000 (21:37 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 22 Apr 2013 11:37:31 +0000 (21:37 +1000)
qcsrc/client/monsters.qc
qcsrc/server/monsters/lib/defs.qh
qcsrc/server/monsters/lib/monsters.qc
qcsrc/server/monsters/monster/ogre.qc
qcsrc/server/monsters/monster/zombie.qc

index d5b7ca7f1875c8df2b559b1f88213ee4422b0dac..39ef4e8a11038161f8e44a0e9b6fe1063d66679e 100644 (file)
@@ -93,7 +93,7 @@ void monster_precache(float _mid)
 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);
 }
 
index 20370f044b6cbb9fdc45b287f3373758c3e664e9..8ebea2ebecfa147f7ae8144ef2146ad24827274f 100644 (file)
@@ -4,6 +4,8 @@
 
 .float candrop;
 
+.float spawn_time; // stop monster from moving around right after spawning
+
 .string oldtarget2;
 .float lastshielded;
 
@@ -20,6 +22,7 @@ const float MONSTERSKILL_NOTHARD = 1024; // monster will not spawn on skill 4
 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)
index 7da1256bb0a190fabe565fad999d951092d45ebf..1ad2861cd85d290ffed565cf56b446ccfa271bb0 100644 (file)
@@ -553,10 +553,11 @@ void monster_move(float runspeed, float walkspeed, float stopspeed, float manim_
                }
        }
        
-       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;
@@ -1030,6 +1031,7 @@ float monster_initialize(string  net_name, float mon_id,
        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)
index 96ede40ffdaeab56660ddeb8999fab65e1d49c14..955c34811a8e06bdf5c4a888482f8177fa038931 100644 (file)
@@ -217,7 +217,7 @@ void ogre_spawn()
        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;
        
index 35855bf89fd34dd41540b2250e51141a72dd4d84..131374b7402398ef656ff99888cd082356a1010f 100644 (file)
@@ -125,7 +125,8 @@ void zombie_spawn()
                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;