From: Lyberta Date: Sun, 18 Feb 2018 05:36:48 +0000 (+0300) Subject: Survival: Started adding monsters. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f8c549dee0692b618cedebf1f2237184d543b328;p=xonotic%2Fxonotic-data.pk3dir.git Survival: Started adding monsters. --- 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;