home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 August / GSSH0804.iso / Geschicklichkeit / Enigma / Enigma-081.exe / data / levels / duffy16.lua < prev    next >
Text File  |  2003-01-30  |  8KB  |  187 lines

  1. levelw=77
  2. levelh=13
  3.  
  4. create_world( levelw, levelh)
  5.  
  6. fill_floor("fl-metal", 0,0,levelw,levelh)
  7.  
  8. function renderLine( line, pattern)
  9.     for i=1, strlen(pattern) do
  10.         local c = strsub( pattern, i, i)
  11.         if c =="#" then
  12.             set_stone( "st-greenbrown", i-1, line)
  13.         elseif c == "o" then
  14.             oxyd( i-1, line)
  15.         elseif c == "P" then
  16.             set_item("it-trigger", i-1,line, {action="onoff",target="laser1"})
  17.         elseif c == "Q" then
  18.             set_item("it-trigger", i-1,line, {action="onoff",target="laser2"})
  19.         elseif c == "R" then
  20.             set_item("it-trigger", i-1,line, {action="onoff",target="laser3"})
  21.         elseif c == "S" then
  22.             set_item("it-trigger", i-1,line, {action="onoff",target="laser4"})
  23.         elseif c == "T" then
  24.             set_item("it-trigger", i-1,line, {action="onoff",target="laser5"})
  25.         elseif c == "U" then
  26.             set_item("it-trigger", i-1,line, {action="onoff",target="laser6"})
  27.         elseif c == "V" then
  28.             set_item("it-trigger", i-1,line, {action="onoff",target="laser7"})
  29.         elseif c == "<" then
  30.             set_item("it-trigger", i-1,line, {action="onoff",target="laser8"})
  31.         elseif c == "X" then
  32.             set_item("it-trigger", i-1,line, {action="onoff",target="laser9"})
  33.         elseif c == "Y" then
  34.             set_item("it-trigger", i-1,line, {action="onoff",target="laser10"})
  35.         elseif c == "a" then
  36.             set_item("it-trigger", i-1,line, {action="onoff",target="laser11"})
  37.         elseif c == "b" then
  38.             set_item("it-trigger", i-1,line, {action="onoff",target="laser12"})
  39.         elseif c == "c" then
  40.             set_item("it-trigger", i-1,line, {action="onoff",target="laser13"})
  41.         elseif c == "d" then
  42.             set_item("it-trigger", i-1,line, {action="onoff",target="laser14"})
  43.         elseif c == "e" then
  44.             set_item("it-trigger", i-1,line, {action="onoff",target="laser15"})
  45.         elseif c == "f" then
  46.             set_item("it-trigger", i-1,line, {action="onoff",target="laser16"})
  47.         elseif c == "g" then
  48.             set_item("it-trigger", i-1,line, {action="onoff",target="laser17"})
  49.         elseif c == "h" then
  50.             set_item("it-trigger", i-1,line, {action="onoff",target="laser18"})
  51.         elseif c == "i" then
  52.             set_item("it-trigger", i-1,line, {action="onoff",target="laser19"})
  53.         elseif c == "j" then
  54.             set_item("it-trigger", i-1,line, {action="onoff",target="laser20"})
  55.         elseif c == "k" then
  56.             set_item("it-trigger", i-1,line, {action="onoff",target="laser21"})
  57.         elseif c == "l" then
  58.             set_item("it-trigger", i-1,line, {action="onoff",target="laser22"})
  59.         elseif c == "m" then
  60.             set_item("it-trigger", i-1,line, {action="onoff",target="laser23"})
  61.         elseif c == "n" then
  62.             set_item("it-trigger", i-1,line, {action="onoff",target="laser24"})
  63.         elseif c == "`" then
  64.             set_item("it-trigger", i-1,line, {action="onoff",target="laser25"})
  65.         elseif c == "z" then    
  66.             set_actor("ac-blackball", i-.5,line+.5, {player=0, mouseforce=1})
  67.           elseif c == "p" then
  68.               set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser1")
  69.           elseif c == "q" then
  70.               set_attrib(laser(i-1,line, TRUE, SOUTH), "name", "laser2")
  71.           elseif c == "r" then
  72.               set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser3")
  73.           elseif c == "s" then
  74.               set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser4")
  75.         elseif c == "t" then
  76.             set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser5")
  77.         elseif c == "u" then
  78.             set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser6")
  79.         elseif c == "v" then
  80.             set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser7")
  81.         elseif c == "," then
  82.             set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser8")
  83.         elseif c == "x" then
  84.             set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser9")
  85.         elseif c == "y" then
  86.              set_attrib(laser(i-1,line, TRUE, EAST), "name", "laser10")
  87.         elseif c == "A" then
  88.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser11")
  89.         elseif c == "B" then
  90.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser12")
  91.         elseif c == "C" then
  92.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser13")
  93.         elseif c == "D" then
  94.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser14")
  95.         elseif c == "E" then
  96.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser15")
  97.         elseif c == "F" then
  98.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser16")
  99.         elseif c == "G" then
  100.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser17")
  101.         elseif c == "H" then
  102.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser18")
  103.         elseif c == "I" then
  104.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser19")
  105.         elseif c == "J" then
  106.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser20")
  107.         elseif c == "K" then
  108.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser21")
  109.         elseif c == "L" then
  110.              set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser22")
  111.         elseif c == "M" then
  112.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser23")
  113.         elseif c == "N" then
  114.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser24")
  115.         elseif c == "~" then
  116.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser25")
  117.                 elseif c == "+" then
  118.             set_stone("st-wood", i-1, line)
  119.         elseif c == "*" then
  120.             set_stone("st-brownie", i-1, line)
  121.         elseif c == "w" then
  122.             draw_stones("st-glass", {i-1,line},{1,0}, 1)
  123.         elseif c == "/" then
  124.             mirrorp(i-1,line,FALSE,FALSE, 4)
  125.         elseif c == ";" then
  126.             mirrorp(i-1,line,FALSE,FALSE, 2)
  127.         elseif c == "?" then
  128.             mirrorp(i-1,line,FALSE,TRUE, 4)
  129.         elseif c == ":" then
  130.             mirrorp(i-1,line,FALSE,TRUE, 2)
  131.         elseif c == "/" then
  132.             mirrorp(i-1,line,FALSE,FALSE, 4)
  133.         elseif c == ";" then
  134.             mirrorp(i-1,line,FALSE,FALSE, 2)
  135.         elseif c == "?" then
  136.             mirrorp(i-1,line,FALSE,TRUE, 4)
  137.         elseif c == ":" then
  138.             mirrorp(i-1,line,FALSE,TRUE, 2)
  139.         elseif c == "|" then
  140.             draw_stones("st-grate1",{i-1,line}, {1,1}, 1)
  141.         elseif c == "0" then
  142.             abyss(i-1,line)
  143.              draw_stones("st-glass", {i-1,line},{1,1}, 1)
  144.         elseif c == "1" then
  145.             fill_floor("fl-leaves", i-1,line,1,1)
  146.             draw_stones("st-glass", {i-1,line},{1,0}, 1)
  147.         elseif c == "2" then
  148.             fill_floor("fl-sand", i-1,line,1,1)
  149.             draw_stones("st-glass", {i-1,line},{1,0}, 1)
  150.         elseif c == "3" then
  151.             fill_floor("fl-bluegreen", i-1,line,1,1)
  152.             draw_stones("st-glass", {i-1,line},{1,0}, 1)
  153.         elseif c == "4" then
  154.             fill_floor("fl-inverse", i-1,line, 1,1)
  155.             draw_stones("st-glass", {i-1,line},{1,0}, 1)
  156.         elseif c == "@" then
  157.             document(i-1,line,"01011-00100-01...")
  158.         elseif c == "Z" then
  159.             document(i-1,line,"The left-most room is important!")
  160.         elseif c == "!" then
  161.             document(i-1,line,"This is the control panel.")
  162.  
  163.                 end
  164.     end
  165. end
  166.  
  167. -- Floor:  " "
  168. -- Border: "#"
  169. -- Oxyd:   "o"
  170.  
  171. renderLine(00, "#############################################################################")
  172. renderLine(01, "#                  #                  #       w/w        w                 ;#")
  173. renderLine(02, "#  0          w    #     021422133    #       www        #                y?#")
  174. renderLine(03, "#            www   #     3       2    #                  #                x?#")
  175. renderLine(04, "#  1    @    w#w   #   * 3 aPbQR 3 *  #                  #                ,?#")
  176. renderLine(05, "#           wwww   #   * 1 cdSef 1 *  #                  #                v?#")
  177. renderLine(06, "#o 2        w##w   |   *   gThij   *  |                 o#                u?#")
  178. renderLine(07, "#          wwwww   #   * 2 kUVlm 2 *  #                  #                t?#")
  179. renderLine(08, "#  3       w###w   #   * 3 <XnY` 3 *  #                  #                s?#")
  180. renderLine(09, "#         wwwwww   #     3   z   2    #                  #                r?#")
  181. renderLine(10, "#  4      w####w   #     321422130    #                  # ABCDEFGHIJKLMN~q #")
  182. renderLine(11, "#         wwwwww   #                  #                  #p::::::::::::::::/#")
  183. renderLine(12, "#############################################################################")
  184.  
  185. oxyd_shuffle()
  186.  
  187.