home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 51 (Bonus) / PCGAMER51B.bin / Games / ABUSE2 / DISK1.DAT / ADDON / DEATHMAT / DSTARTUP.LSP < prev    next >
Lisp/Scheme  |  1996-02-16  |  5KB  |  143 lines

  1. (load "addon/deathmat/levelset.lsp")  ; created by server setup
  2.  
  3. (setq current_net_level 0)
  4.  
  5. (if (not (get_option "-f"))  ;; are they trying to override the first level?
  6.     (set_first_level (nth current_net_level net_levels)))
  7.  
  8. (if (am_a_client)
  9.     (progn
  10.       (load "addon/deathmat/cur_lev.lsp")
  11.       (set_first_level (nth current_net_level net_levels)))
  12.   
  13.   ;; save the level we are so joining clients know which one to load
  14.   (open_file "addon/deathmat/cur_lev.lsp" "wb" 
  15.          (print `(setq current_net_level ,current_net_level))))
  16.   
  17.  
  18. ;; this is a simple check to see if they player has an engine version
  19. ;; capable of playing the game.  All games should at least check for version 1.10
  20. ;; because all version before that are beta and have known bugs.
  21.  
  22. (if (< (+ (* (major_version) 100) (minor_version)) 120)    ; require at least version 1.20
  23.     (progn
  24.       (print "Your engine is out of date.  This game requires version 1.2")
  25.       (quit)))
  26.  
  27. (setq section 'game_section)
  28. (load "lisp/english.lsp")             ;; load language specific stuff
  29.  
  30. (setq load_warn nil)
  31. (if (not (load "lisp/common.lsp"))
  32.     (progn
  33.       (print "\nPlease make sure you unzipped the game with the -d option")
  34.       (print "so that all directories get created properly.")      
  35.       (print "example : pkunzip -d abusXXXX.zip")      
  36.       (quit)))
  37. (setq load_warn T)
  38.  
  39. (setq load_warn nil)
  40.  
  41. (if (am_a_client)
  42.     (if (not (load "addon/deathmat/version.lsp"))
  43.     (progn
  44.       (print "\nThis server is playing an older version, please upgrade it")
  45.       (quit))
  46.       (if (or (not (eq server_version_major (major_version)))
  47.           (not (eq server_version_minor (minor_version))))
  48.       (progn
  49.         (print "\nThis server is playing a different version, cannot continue")
  50.         (quit))))
  51.   (open_file "addon/deathmat/version.lsp" "wb"
  52.          (print (list 'setq 'server_version_major (major_version) ))
  53.          (print (list 'setq 'server_version_minor (minor_version)))))
  54.           
  55.  
  56. (if (not (am_a_client))
  57.     (setq username "Myself"))
  58.  
  59. ;(let ((input (nice_input "DEATHMATCH : Enter your name below" "Name" username)))
  60. ;  (open_file "addon/deathmat/username.lsp" "wb"
  61. ;         (print (list 'setq 'username 
  62. ;              (concatenate 'string '(#\") input '(#\"))))))
  63.  
  64. (local_load "addon/deathmat/username.lsp")
  65. (set_login username)
  66.  
  67.  
  68. (setq load_warn T)
  69.  
  70. (if (not (am_a_client))   ;;  are we connecting to a server?
  71.     (start_server))
  72.  
  73.  
  74.  
  75.  
  76. (load "lisp/userfuns.lsp")
  77.  
  78. ;; this function is called at the end of every screen update
  79. ;; for death match we use this to display a list of players in the
  80. ;; game and the kills for each player
  81.  
  82. (defun display_player (player text_x text_y)
  83.   (if player
  84.       (with_object player    
  85.     (put_string (get_main_font) text_x text_y 
  86.             (concatenate 'string (digstr (kills) 2) " " (player_name) 
  87.                              (if (local_player) 
  88.                              " <<"
  89.                                ""))
  90.             (aref player_text_color (player_number)))
  91.     (display_player (next_focus player) text_x (+ text_y (font_height (get_main_font)))))))
  92.  
  93.  
  94. (defun post_render ()
  95.   (if (not (edit_mode))      ; don't try this in edit mode
  96.       (score_draw)))
  97.  
  98. ;      (display_player (first_focus)  (with_object (first_focus) (+ (view_x1) 4)) (with_object (first_focus) (view_y1))  )))
  99.  
  100. (load "lisp/chat.lsp")
  101.  
  102. (setq keep_backup T)                  ;; determines if Save
  103. (setq load_warn nil)
  104.  
  105. (local_load "gamma.lsp")              ;; load gamma correction values if they have been saved
  106.  
  107. (if (not (load "hardness.lsp"))       ;; load hardness, if no file set to hard
  108.     (setf difficulty        'hard))
  109. (setq load_warn T)
  110.  
  111. ; *********** Defaults **************************
  112. (setf sfx_directory     "sfx/")
  113.  
  114. (load_big_font     "art/fonts.spe" "screen11")
  115. (load_small_font   "art/fonts.spe" "small_font")
  116. (load_console_font "art/fonts.spe" "fnt5x7")
  117.  
  118. (load_color_filter "art/back/backgrnd.spe")
  119. (load_palette      "art/back/backgrnd.spe")
  120. (setq normal_tint (def_tint "art/back/backgrnd.spe"))
  121.  
  122. (load_tiles "art/fore/foregrnd.spe"
  123.         "art/fore/techno.spe"
  124.         "art/fore/techno2.spe"
  125.         "art/fore/techno3.spe"
  126.         "art/fore/techno4.spe"
  127.         "art/fore/cave.spe"
  128.  
  129.         "art/back/intro.spe"
  130.         "art/back/city.spe"
  131.         "art/back/tech.spe"
  132.         "art/back/cave.spe"
  133.         "art/back/backgrnd.spe")
  134.  
  135. (setq load_warn nil)
  136. (load "register/tiles.lsp")       ;; load up registered artwork if it's there
  137. (setq load_warn T)
  138.  
  139. (setf title_screen      '("art/title.spe" . "title_screen"))
  140. (setf logo              '("art/title.spe" . "cdc_logo"))
  141. ;(setq help_screens '("art/help.spe" "sell1" "sell2" "sell4"))
  142.  
  143.