From f8c549dee0692b618cedebf1f2237184d543b328 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Sun, 18 Feb 2018 08:36:48 +0300 Subject: [PATCH] Survival: Started adding monsters. --- .../gamemode/survival/sv_survival.qc | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc b/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc index d4d33925ac..5454d74d76 100644 --- a/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc +++ b/qcsrc/common/gamemodes/gamemode/survival/sv_survival.qc @@ -1005,6 +1005,29 @@ void Surv_UpdateAliveStats() Surv_UpdateDefenderHealthStat(); } +/// \brief Spawns a monster. +void Surv_SpawnMonster() +{ + entity spawn_point = SelectSpawnPoint(NULL, true); + RandomSelection_Init(); + FOREACH(Monsters, it != MON_Null, + { + 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)) + { + continue; + } + RandomSelection_AddEnt(it, 1, 1); + }); + entity monster = spawnmonster(spawn(), RandomSelection_chosen_ent.netname, + RandomSelection_chosen_ent.monsterid, NULL, NULL, spawn_point.origin, + false, false, 2); + monster.team = surv_attackerteam; +} + /// \brief Updates defender health on the HUD. /// \return No return. void Surv_UpdateDefenderHealthStat() @@ -1468,6 +1491,10 @@ void Surv_RoundStart() break; } } + for (int i = 0; i < 8; ++i) + { + Surv_SpawnMonster(); + } if (autocvar_g_surv_stealth) { return; -- 2.39.5