#RequireContext CSmMode #Include "MathLib" as MathLib #Include "TextLib" as TextLib #Include "Libs/Nadeo/Mode.Script.txt" as Mode #Include "Libs/Nadeo/ShootMania/SM.Script.txt" as SM #Include "Libs/Nadeo/ShootMania/Score.Script.txt" as Score #Const CompatibleMapTypes "MeleeArena" #Const Version "2012-07-06" /* -------------------------------------- */ // Settings /* -------------------------------------- */ #Setting S_TimeLimit 600 as _("Time limit") ///< Time limit on a map #Setting S_PointLimit 25 as _("Point limit") ///< Point limit on a map #Const C_UITickInterval 200 ///< Time interval between UI update /* -------------------------------------- */ // Globales variables /* -------------------------------------- */ declare Ident[] G_SpawnsList; ///< Id of all the BlockSpawns of the map declare Ident G_LatestSpawnId; ///< Id of the last BlockSpawn used /* -------------------------------------- */ // Functions /* -------------------------------------- */ /* -------------------------------------- */ /// Fill the SpawnsList with all the BlockSpanws of the map Void FillSpawnsList() { foreach (BlockSpawn in BlockSpawns) { G_SpawnsList.add(BlockSpawn.Id); } } /* ------------------------------------- */ /** Spawn a player * * @param _Player The player to spawn */ Void SpawnPlayers(CSmPlayer _Player) { if (G_SpawnsList.count == 0) FillSpawnsList(); declare SpawnId = NullId; while (True) { SpawnId = G_SpawnsList[MathLib::Rand(0, G_SpawnsList.count - 1)]; if (SpawnId != G_LatestSpawnId) break; if (G_SpawnsList.count == 1) break; } SM::SpawnPlayer(_Player, 0, BlockSpawns[SpawnId]); G_LatestSpawnId = SpawnId; declare Tmp = G_SpawnsList.remove(SpawnId); } /* ------------------------------------- */ /** Update the infos UI of a player * * @param _Player The player to update * * @return The ManiaLink string */ Text UpdateLayerInfos(CSmPlayer _Player) { if (_Player.Score == Null) return ""; return """