home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 103 / af103sub.adf / Hugo.LZX / Hugo / Examples / shell.hug < prev   
Text File  |  1997-08-22  |  2KB  |  91 lines

  1. !\---------------------------------------------------------------------------
  2.     
  3.     HUGO v2.3 SHELL
  4.     by Kent Tessman (c) 1995-1997
  5.  
  6. ---------------------------------------------------------------------------\!
  7.  
  8. ! Uncomment the following to use a precompiled version of the Hugo Library:
  9. ! #set PRECOMPILED_LIBRARY
  10.  
  11. ! Uncomment the following to include the HugoFix Debugging Library:
  12. ! #set DEBUG
  13.  
  14. ! Uncomment the following to include verb stub routines:
  15. ! #set VERBSTUBS
  16.  
  17. #include "grammar.g"                    ! grammar must come first
  18.  
  19. #ifset PRECOMPILED_LIBRARY
  20. #link "hugolib.hlb"
  21. #endif
  22. #ifclear PRECOMPILED_LIBRARY
  23. #include "hugolib.h"
  24. #endif
  25.  
  26. routine init
  27. {
  28.     counter = -1
  29.  
  30.     STATUSTYPE = 1                  ! score/turns
  31.     TEXTCOLOR = DEF_FOREGROUND
  32.     BGCOLOR = DEF_BACKGROUND
  33.     SL_TEXTCOLOR = BRIGHT_WHITE
  34.     SL_BGCOLOR = BLUE
  35.  
  36.     prompt = ">"
  37.     color TEXTCOLOR, BGCOLOR
  38.  
  39.     cls
  40.     Font(BOLD_ON | DEFAULT_FONT)
  41.     "SHELL"
  42.     Font(BOLD_OFF)
  43.     "An Interactive Starting Point\n"
  44.     print BANNER
  45.  
  46.     player = you                    ! player initialization
  47.     location = emptyroom
  48.     old_location = location        
  49.     
  50.     move player to location
  51.     FindLight(location)
  52.     DescribePlace(location)
  53.     location is visited
  54.     CalculateHolding(player)
  55.  
  56. #ifset USE_PLURAL_OBJECTS
  57.     InitPluralObjects
  58. #endif
  59. }
  60.  
  61. #ifset PRECOMPILED_LIBRARY
  62. replace main
  63. {
  64. #endif
  65. #ifclear PRECOMPILED_LIBRARY
  66. routine main
  67. {
  68. #endif
  69.     counter = counter + 1
  70.     PrintStatusLine
  71.     run location.each_turn
  72.     runevents
  73.     RunScripts
  74.     if parent(speaking)~=location
  75.         speaking = 0
  76. }
  77.  
  78. character you "you"
  79. {
  80.     nouns "me", "myself"
  81.     pronouns "you", "you", "your", "yourself"
  82.     capacity 100
  83.     long_desc {"Looking good."}
  84.     is plural                       ! for matching second-person verbs
  85.     is hidden            ! for location descriptions
  86. }
  87.  
  88. room emptyroom "empty room"
  89. {
  90. }
  91.