home *** CD-ROM | disk | FTP | other *** search
/ Superpower (Alt) / SUPERPOWER.iso / q / patch / mbq090 / _levsel.qc < prev    next >
Encoding:
Text File  |  1996-08-29  |  3.1 KB  |  86 lines

  1. /*
  2. **
  3. ** _levsel.qc (LevelSelect Code, 1.0)
  4. **
  5. ** Copyright (C) 1996 Johannes Plass
  6. ** 
  7. ** This program is free software; you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation; either version 2 of the License, or
  10. ** (at your option) any later version.
  11. ** 
  12. ** This program is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with this program; if not, write to the Free Software
  19. ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ** 
  21. ** Author:   Johannes Plass (plass@dipmza.physik.uni-mainz.de)
  22. **
  23. */
  24.  
  25.  
  26. void(entity player) LevelSelectInit =
  27. {
  28.    if (!USE_MODULE_LEVELSELECT) return;
  29.    // nothing to do
  30. };
  31.  
  32. void(entity player) LevelSelectInfo =
  33. {
  34.    if (!USE_MODULE_LEVELSELECT) return;
  35.    // nothing to do
  36. };
  37.  
  38. void() LevelSelectSelectLevel =
  39. {
  40.    if (!USE_MODULE_LEVELSELECT) return;
  41.  
  42.    // 'mapname' is the name of the level which just ended
  43.    // 'nextmap' is the name of the map quake proposes to be the next one
  44.  
  45.    if      (                     nextmap == "end"  ) nextmap = "dm1"   ;
  46.    else if (mapname == "dm6"                       ) nextmap = "end"   ;
  47.    else if (mapname == "end"                       ) nextmap = "start" ;
  48.  
  49.    return;
  50. };
  51.  
  52. /*
  53. ========================================================================
  54.    EXAMPLE
  55. ========================================================================
  56.  
  57.    if      (                     nextmap == "end"  ) nextmap = "dm1"   ;
  58.    else if (mapname == "dm6"                       ) nextmap = "end"   ;
  59.    else if (mapname == "end"                       ) nextmap = "start" ;
  60.    else if (                     nextmap == "e1m1" ) nextmap = "e1m2"  ;
  61.    else if (mapname == "e1m3"                      ) nextmap = "e1m5"  ;
  62.    else if (mapname == "e1m7"                      ) nextmap = "e1m8"  ;
  63.    else if (mapname == "e1m8"                      ) nextmap = "start" ;
  64.  
  65.    What does the example above ?
  66.  
  67.    Line 1: When Quake wants to play the level "end", we will go to level
  68.            "dm1" instead.
  69.    Line 2: When map "dm6" has ended, Quake usually wants to go to level
  70.            "dm1". But no, we prefer to branch to level "end".
  71.    Line 3: Quake proposes level "e1m1". No, it's ugly, we skip that one
  72.            and go to "e1m2" immediately.
  73.    Line 4: The map "e1m3" just ended. This level has two exits, branching
  74.            to "e1m8" and "e1m4".
  75.            No, we don't like "e1m4" in deathmatch and "e1m8" will be played
  76.            later, so we go to "e1m5" now.
  77.    Line 5: Level "e1m7" just ended and Quake wants to go back to the "start"
  78.            now. We override this and play the secret level "e1m8".
  79.    Line 6: After playing the secret level "e1m8", Quake wants us to play
  80.            "e1m5". However, we already visited this one earlier, so let's
  81.            go the the "start" level.
  82.  
  83. ===========================================================================
  84. */
  85.  
  86.