Commit a9fccfde authored by Mario's avatar Mario

Add a hidden flag to monsters, so they don't show up in random spawning,...

Add a hidden flag to monsters, so they don't show up in random spawning, invasion or mob lists (similar to passive type, but more generally hidden)
parent 2cee5d0c
Pipeline #5704788 passed with stages
in 18 minutes and 41 seconds
......@@ -13,6 +13,7 @@ const int MON_FLAG_RIDE = BIT(12); // monster can be ridden in special modes
const int MONSTER_SIZE_QUAKE = BIT(13);
const int MONSTER_TYPE_PASSIVE = BIT(14); // doesn't target or chase enemies
const int MONSTER_TYPE_UNDEAD = BIT(15); // monster is by most definitions a zombie (doesn't fully die unless gibbed)
const int MON_FLAG_HIDDEN = BIT(16);
// entity properties of monsterinfo:
.bool(int, entity actor, entity targ, .entity weaponentity) monster_attackfunc;
......
......@@ -20,7 +20,7 @@ entity spawnmonster (entity e, string monster, int monster_id, entity spawnedby,
if(monster == "random")
{
RandomSelection_Init();
FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MONSTER_TYPE_PASSIVE),
FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN),
{
RandomSelection_AddEnt(it, 1, 1);
});
......
......@@ -288,7 +288,7 @@ string getmonsterlist()
{
string monsterlist = "";
FOREACH(Monsters, it != MON_Null,
FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MON_FLAG_HIDDEN),
{
string col = ((i % 2) ? "^2" : "^3");
monsterlist = sprintf("%s%s%s ", monsterlist, col, it.netname);
......
......@@ -31,7 +31,8 @@ Monster invasion_PickMonster(int supermonster_count)
FOREACH(Monsters, it != MON_Null,
{
if((it.spawnflags & MONSTER_TYPE_PASSIVE) || (it.spawnflags & MONSTER_TYPE_FLY) || (it.spawnflags & MONSTER_TYPE_SWIM) || (it.spawnflags & MONSTER_SIZE_QUAKE) || ((it.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1))
if((it.spawnflags & MON_FLAG_HIDDEN) || (it.spawnflags & MONSTER_TYPE_PASSIVE) || (it.spawnflags & MONSTER_TYPE_FLY) || (it.spawnflags & MONSTER_TYPE_SWIM) ||
(it.spawnflags & MONSTER_SIZE_QUAKE) || ((it.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1))
continue;
if(autocvar_g_invasion_zombies_only && !(it.spawnflags & MONSTER_TYPE_UNDEAD))
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment