home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 August / GSSH0804.iso / Geschicklichkeit / Enigma / Enigma-081.exe / data / levels / ss_esp96.lua < prev    next >
Text File  |  2003-08-06  |  7KB  |  158 lines

  1. -- Smutty Smurf 2003
  2. -- ESPRIT #096
  3.  
  4. levelw = 39
  5. levelh = 25
  6. create_world(levelw, levelh)
  7. oxyd_default_flavor = "b"
  8. set_actor("ac-blackball", 28.5,19.5, {player=0})
  9. fill_floor("fl-abyss",0,0,levelw,levelh)
  10. fill_floor("fl-normal",0,0,20,13)
  11.  
  12. function renderLine( line, pattern)
  13.     for i=1, strlen(pattern) do
  14.       local c = strsub( pattern, i, i)
  15.       if c ==   "#" then
  16.          set_stone("st-rock1", i-1,line)
  17.       elseif c=="-" then
  18.          set_floor("fl-wood", i-1,line)
  19.       elseif c=="." then
  20.          set_item("it-tinyhill",i-1,line)
  21.          set_floor("fl-wood", i-1,line)      
  22.       elseif c=="o" then
  23.          set_item("it-tinyhollow",i-1,line)
  24.          set_floor("fl-wood", i-1,line)       
  25.       elseif c=="*" then
  26.          set_item("it-hill",i-1,line)
  27.          set_floor("fl-wood", i-1,line)      
  28.       elseif c=="0" then
  29.          set_item("it-hollow",i-1,line)
  30.          set_floor("fl-wood", i-1,line)   
  31.       elseif c=="f" then
  32.          set_item("it-flagblack",i-1,line)   
  33.          set_floor("fl-wood", i-1,line)          
  34.       elseif c=="P" then
  35.          set_item("it-coffee",i-1,line) 
  36.          set_floor("fl-wood", i-1,line)      
  37.       elseif c=="V" then
  38.          set_item("it-wormhole",i-1,line,{targetx=18.5,targety=2.5,strength=0}) 
  39.          set_floor("fl-wood", i-1,line)                           
  40.       elseif c=="k" then
  41.          set_stone("st-blocker",i-1,line,{name="blocker"}) 
  42.          set_floor("fl-wood", i-1,line)             
  43.       elseif c=="h" then
  44.          set_stone("st-rock1_hole",i-1,line) 
  45.          set_floor("fl-wood", i-1,line)         
  46.       elseif c=="W" then
  47.          set_stone("st-door_c", i-1,line,{name="doorw"}) 
  48.          set_item("it-spade",i-1,line)
  49.          set_floor("fl-normal", i-1,line)       
  50.       elseif c=="X" then
  51.          set_stone("st-door_c", i-1,line,{name="doorx"}) 
  52.          document(i-1,line,"It's easier with a shovel!")
  53.          set_floor("fl-normal", i-1,line)   
  54.       elseif c=="Y" then
  55.          set_stone("st-door_c", i-1,line,{name="doory"}) 
  56.          set_item("it-key_a",i-1,line)
  57.          set_floor("fl-normal", i-1,line)   
  58.       elseif c=="Z" then
  59.          set_stone("st-door_c", i-1,line,{name="doorz"}) 
  60.          set_item("it-coffee",i-1,line)
  61.          set_floor("fl-normal", i-1,line)      
  62.       elseif c=="K" then
  63.          set_stone("st-key_a",i-1,line, {action="openclose", target="blocker"}) 
  64.       elseif c == "w" then
  65.          set_stone("st-timeswitch",i-1,line, {action="callback", target="s1"})
  66.       elseif c == "x" then
  67.          set_stone("st-timeswitch",i-1,line, {action="callback", target="s2"})
  68.       elseif c == "y" then
  69.          set_stone("st-timeswitch",i-1,line, {action="callback", target="s3"})
  70.       elseif c == "z" then
  71.          set_stone("st-timeswitch",i-1,line, {action="callback", target="s4"})         
  72.       elseif c == "D" then
  73.          set_stone("st-death",i-1,line)
  74.       elseif c == "S" then
  75.          set_floor("fl-swamp",i-1,line)         
  76.       elseif c == "F" then
  77.          set_stone("st-fourswitch",i-1,line)         
  78.       elseif c=="1" then
  79.      set_floor("fl-gradient",  i-1,  line, {type=3})         
  80.       elseif c=="2" then
  81.      set_floor("fl-gradient",  i-1,  line, {type=4})   
  82.       elseif c=="3" then
  83.      set_floor("fl-gradient",  i-1,  line, {type=1})   
  84.       elseif c=="4" then
  85.      set_floor("fl-gradient",  i-1,  line, {type=2})         
  86.       elseif c=="a" then
  87.          set_floor("fl-gradient",  i-1,  line, {type=12})   
  88.       elseif c=="b" then
  89.          set_floor("fl-gradient",  i-1,  line, {type=10})         
  90.       elseif c=="c" then
  91.          set_floor("fl-gradient",  i-1,  line, {type=11})   
  92.       elseif c=="d" then
  93.          set_floor("fl-gradient",  i-1,  line, {type=9})   
  94.       elseif c=="O" then
  95.      oxyd(i-1,line)         
  96.         end
  97.     end  
  98. end
  99. --               012345678901234567890123456789012345678
  100. renderLine(00 , "#######################################")
  101. renderLine(01 , "#                  #                  #")
  102. renderLine(02 , "#  X  W  Y  Z   K  # F  V---o--o- --- #")
  103. renderLine(03 , "#                  #            - - o #")
  104. renderLine(04 , "#                  k--o-**0o-o  --o - #")  
  105. renderLine(05 , "#                  #         0      o #")
  106. renderLine(06 , "#                  #         oP--   - #")
  107. renderLine(07 , "#    z             #       ---  --o-- #")
  108. renderLine(08 , "#                  #       o          #")
  109. renderLine(09 , "#  x   y           #       .-o        #")
  110. renderLine(10 , "#                  #         f        #")
  111. renderLine(11 , "#    w             #        -o        #")
  112. renderLine(12 , "#DDDDDDDDDDDDDDDDDD#########h##########") 
  113.                                                         
  114. renderLine(13 , "Da4444444444444444b#0       -         #")
  115. renderLine(14 , "D2O44444444444444O1#0       - ----    #")
  116. renderLine(15 , "D22a444444444444b11#0       - .  -    #")
  117. renderLine(16 , "D222a4444444444b111h0   ----- -  -    #")
  118. renderLine(17 , "D2222a44444444b1111#0   .     .  -    #")  
  119. renderLine(18 , "D22222SSSSSSSS11111#0   -     -  -    #")
  120. renderLine(19 , "D2222c33333333d1111#0   ------.  -    #")
  121. renderLine(20 , "D222c3333333333d111#0            .-.- #")
  122. renderLine(21 , "D22c333333333333d11#0               - #")
  123. renderLine(22 , "D2O33333333333333O1#00000000--.--o--- #")
  124. renderLine(23 , "Dc3333333333333333d#0                 #")
  125. renderLine(24 , "#DDDDDDDDDDDDDDDDDD####################")
  126. --               012345678901234567890123456789012345678
  127.                                
  128. function s1() sx(1) end                               
  129. function s2() sx(2) end 
  130. function s3() sx(3) end 
  131. function s4() sx(4) end                               
  132.  
  133. local flag = {0,0,0,0,}
  134. x = 0
  135.  
  136. function sx(num)                               
  137. %flag[num] = 1-%flag[num]
  138. if (%flag[1]+%flag[2]+%flag[3]+%flag[4]==4) then                     -- open, if all timeswitches are on   
  139.    x = x+1
  140.    if x == 5 then x = 1 end
  141.    enigma.SendMessage(enigma.GetNamedObject("doorw"), "close", nil) 
  142.    enigma.SendMessage(enigma.GetNamedObject("doorx"), "close", nil)
  143.    enigma.SendMessage(enigma.GetNamedObject("doory"), "close", nil)
  144.    enigma.SendMessage(enigma.GetNamedObject("doorz"), "close", nil)
  145.    if x == 1 then
  146.      enigma.SendMessage(enigma.GetNamedObject("doorw"), "open", nil) 
  147.    elseif x == 2 then
  148.      enigma.SendMessage(enigma.GetNamedObject("doorx"), "open", nil)
  149.    elseif x == 3 then
  150.      enigma.SendMessage(enigma.GetNamedObject("doory"), "open", nil)
  151.    elseif x == 4 then
  152.      enigma.SendMessage(enigma.GetNamedObject("doorz"), "open", nil)
  153.    end          
  154.   end
  155. end                              
  156.                                
  157. oxyd_shuffle()
  158.