.vector glowmod;
+.float miniboss;
void monster_changeteam()
{
self.glowmod = Team_ColorRGB(self.team - 1);
void monster_construct()
{
entity mon = get_monsterinfo(self.monsterid);
+ vector min_s, max_s;
- if(mon.spawnflags & MONSTER_SIZE_BROKEN)
- self.scale = 1.3;
+ if(self.miniboss)
+ {
+ if(mon.spawnflags & MONSTER_SIZE_BROKEN)
+ self.scale = 1.95;
+ else
+ self.scale = 1.5;
+
+ min_s = mon.mins * 1.5;
+ max_s = mon.maxs * 1.5;
+
+ }
+ else
+ {
+ if(mon.spawnflags & MONSTER_SIZE_BROKEN)
+ self.scale = 1.3;
+ else
+ self.scale = 1;
+
+ min_s = mon.mins;
+ max_s = mon.maxs;
+ }
self.netname = M_NAME(self.monsterid);
setorigin(self, self.origin);
setmodel(self, mon.model);
- setsize(self, mon.mins, mon.maxs);
+ setsize(self, min_s, max_s);
self.move_movetype = MOVETYPE_BOUNCE;
self.health = 255;
self.skin = ReadByte();
self.team = ReadByte();
+
+ self.miniboss = ReadByte();
monster_construct();
monster_changeteam();
self.health += autocvar_g_monsters_miniboss_healthboost;
if not(self.weapon)
self.weapon = WEP_NEX;
+
+ entity mon = get_monsterinfo(self.monsterid);
+
+ if(mon.spawnflags & MONSTER_SIZE_BROKEN)
+ self.scale = 1.95;
+ else
+ self.scale = 1.5;
+
+ setsize(self, mon.mins * 1.5, mon.maxs * 1.5);
+ setorigin(self, self.origin + '0 0 25'); // offset so we don't fall through the floor
}
}
WriteByte(MSG_ENTITY, self.skin);
WriteByte(MSG_ENTITY, self.team);
+ WriteByte(MSG_ENTITY, (self.spawnflags & MONSTERFLAG_MINIBOSS));
}
if(sf & MSF_ANG)
if not(self.spawnflags & MONSTERFLAG_SPAWNED) // naturally spawned monster
if not(self.monster_respawned)
monsters_total += 1;
-
+
setsize(self, mon.mins, mon.maxs);
self.flags = FL_MONSTER;
self.takedamage = DAMAGE_AIM;
self.reset = monsters_reset;
self.netname = mon.netname;
self.monster_name = M_NAME(mon_id);
+ self.scale = 1;
self.candrop = TRUE;
self.view_ofs = '0 0 1' * (self.maxs_z * 0.5);
self.oldtarget2 = self.target2;
self.deadflag = DEAD_NO;
- self.scale = 1;
self.noalign = nodrop;
self.spawn_time = time;
self.gravity = 1;
self.flags |= FL_FLY;
self.movetype = MOVETYPE_FLY;
}
-
+
if(mon.spawnflags & MONSTER_SIZE_BROKEN)
self.scale = 1.3;
}
monster = spawnmonster("", mon, spawn_point, spawn_point, spawn_point.origin, FALSE, 2);
+
+ if(roundcnt >= maxrounds)
+ monster.spawnflags |= MONSTERFLAG_MINIBOSS;
}
void invasion_SpawnMonsters(float supermonster_count)
return 1;
}
- float total_alive_monsters = 0, supermonster_count = 0;
-
- FOR_EACH_MONSTER(head) if(head.health > 0)
+ // boss round
+ if(roundcnt >= maxrounds)
{
- if((get_monsterinfo(head.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
- ++supermonster_count;
- ++total_alive_monsters;
+ if(numspawned < 1)
+ {
+ maxspawned = 1;
+ invasion_SpawnMonsters(0);
+ }
}
-
- if((total_alive_monsters + numkilled) < maxspawned && maxcurrent < 10) // 10 at a time should be plenty
+ else
{
- if(time >= last_check)
+ float total_alive_monsters = 0, supermonster_count = 0;
+
+ FOR_EACH_MONSTER(head) if(head.health > 0)
{
- invasion_SpawnMonsters(supermonster_count);
- last_check = time + 2;
+ if((get_monsterinfo(head.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
+ ++supermonster_count;
+ ++total_alive_monsters;
+ }
+
+ if((total_alive_monsters + numkilled) < maxspawned && maxcurrent < 10) // 10 at a time should be plenty
+ {
+ if(time >= last_check)
+ {
+ invasion_SpawnMonsters(supermonster_count);
+ last_check = time + 2;
+ }
+
+ return 0;
}
-
- return 0;
}
if(numspawned < 1 || numkilled < maxspawned)
MUTATOR_HOOKFUNCTION(invasion_MonsterSpawn)
{
- if(self.realowner == world)
+ if not(self.spawnflags & MONSTERFLAG_SPAWNED)
{
if(self.weaponentity) remove(self.weaponentity);
if(self.iceblock) remove(self.iceblock);
return FALSE;
}
+ if(roundcnt < maxrounds && self.spawnflags & MONSTERFLAG_MINIBOSS)
+ self.spawnflags &= ~MONSTERFLAG_MINIBOSS;
+
if not(self.monster_respawned)
{
numspawned += 1;