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

  1. --Siegfried Fennig 24.05.2003 Rev.0
  2.  
  3. levelw = 20
  4. levelh = 13
  5.  
  6. create_world(levelw, levelh)
  7. enigma.ConserveLevel = FALSE
  8. oxyd_default_flavor = "d"
  9. fill_floor("fl-samba", 0, 0, level_width, level_height)
  10.  
  11. function renderLine( line, pattern)
  12.     for i=1, strlen(pattern) do
  13.       local c = strsub( pattern, i, i)
  14.       if c =="t" then
  15.          set_stone("st-timeswitch",i-1,line)
  16.       elseif c == "w" then
  17.          set_stone("st-break_acwhite",i-1,line)
  18.       elseif c == "1" then
  19.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback1"})
  20.       elseif c == "2" then
  21.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback2"})
  22.       elseif c == "3" then
  23.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback3"})
  24.       elseif c == "4" then
  25.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback4"})
  26.       elseif c == "5" then
  27.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback5"})
  28.       elseif c == "6" then
  29.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback6"})
  30.       elseif c == "7" then
  31.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback7"})
  32.       elseif c == "8" then
  33.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback8"})
  34.       elseif c == "9" then
  35.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback9"})
  36.       elseif c == "l" then
  37.          set_attrib(laser(i-1,line, FALSE, NORTH), "name", "laser")
  38.       elseif c == "A" then
  39.          set_attrib(mirror3(i-1,line,0,0,2), "name", "mirror01")
  40.       elseif c == "B" then
  41.          set_attrib(mirrorp(i-1,line,0,1,3), "name", "mirror02")
  42.       elseif c == "C" then
  43.          set_attrib(mirror3(i-1,line,0,0,4), "name", "mirror03")
  44.       elseif c == "D" then
  45.          set_attrib(mirrorp(i-1,line,0,0,4), "name", "mirror04")
  46.       elseif c == "E" then
  47.          set_attrib(mirrorp(i-1,line,0,1,4), "name", "mirror05")
  48.       elseif c == "F" then
  49.          set_attrib(mirror3(i-1,line,0,1,1), "name", "mirror06")
  50.       elseif c == "G" then
  51.          set_attrib(mirrorp(i-1,line,0,0,1), "name", "mirror07")
  52.       elseif c == "H" then
  53.          set_attrib(mirrorp(i-1,line,0,1,2), "name", "mirror08")
  54.       elseif c == "I" then
  55.          set_attrib(mirror3(i-1,line,0,0,2), "name", "mirror09")
  56.       elseif c == "K" then
  57.          set_attrib(mirror3(i-1,line,0,0,2), "name", "mirror10")
  58.       elseif c == "L" then
  59.          set_attrib(mirror3(i-1,line,0,0,2), "name", "mirror11")
  60.       elseif c == "M" then
  61.          set_attrib(mirrorp(i-1,line,0,0,2), "name", "mirror12")
  62.       elseif c == "N" then
  63.          set_attrib(mirror3(i-1,line,0,0,1), "name", "mirror13")
  64.       elseif c == "O" then
  65.          set_attrib(mirrorp(i-1,line,0,1,4), "name", "mirror14")
  66.       elseif c == "P" then
  67.          set_attrib(mirror3(i-1,line,0,0,3), "name", "mirror15")
  68.       elseif c == "Q" then
  69.          set_attrib(mirrorp(i-1,line,0,0,2), "name", "mirror16")
  70.       elseif c == "o" then
  71.          oxyd( i-1, line)
  72.       elseif c == "a" then
  73.          set_actor("ac-blackball", i, line+.5, {player=0})
  74.         end
  75.     end
  76. end
  77. --              01234567890123456789
  78. renderLine(00, "tt8ttttttttttttttttt")
  79. renderLine(01, "t  to o o o o owwwwt")
  80. renderLine(02, "1  twwwwwwwwwwwwwwwt")
  81. renderLine(03, "2  twwwwwwwwwwwwwwwt")
  82. renderLine(04, "3  twwwwwwwwwwwwwwwt")
  83. renderLine(05, "4  tABwwCwDwEwFwwwwt")
  84. renderLine(06, "5  twwwwwwwwwwwwwwwt")
  85. renderLine(07, "6a tGHIwKwLwMwNwwwwt")
  86. renderLine(08, "t  twwwwwwwwwwwwwwwt")
  87. renderLine(09, "7  twOwwPwQwwwwwwwwt")
  88. renderLine(10, "t  twwwwwwwwwwwwwwwt")
  89. renderLine(11, "t  twwwwwwwwwwwwwwwt")
  90. renderLine(12, "tt9ttltttttttttttttt")
  91. --              01234567890123456789
  92.  
  93. oxyd_shuffle()
  94.  
  95. switch1 = 0
  96. switch2 = 0
  97. switch3 = 0
  98. switch4 = 0
  99. switch5 = 0
  100. switch6 = 0
  101. switch7 = 0
  102. switch8 = 0
  103. switch9 = 0
  104.  
  105. function switchaction()
  106.     lasera=enigma.GetNamedObject("laser")
  107.     if switch8 == 1 or switch9 == 1 then
  108.        enigma.SendMessage(lasera, "on", nil)
  109.     end
  110.     if switch8 == 0 and switch9 == 0 then
  111.        enigma.SendMessage(lasera, "off", nil)
  112.     end
  113.     mir1=enigma.GetNamedObject("mirror01")
  114.     mir2=enigma.GetNamedObject("mirror02")
  115.     if switch1 == 1 or switch4 == 1 then
  116.        enigma.SendMessage(mir1, "mirror-east", nil)
  117.        enigma.SendMessage(mir2, "mirror-east", nil)
  118.     end
  119.     if switch1 == 0 and switch4 == 0 then
  120.        enigma.SendMessage(mir1, "mirror-west", nil)
  121.        enigma.SendMessage(mir2, "mirror-north", nil)
  122.     end
  123.     mir3=enigma.GetNamedObject("mirror03")
  124.     if switch2 == 1 or switch4 == 1 then
  125.        enigma.SendMessage(mir3, "mirror-north", nil)
  126.     end
  127.     if switch2 == 0 and switch4 == 0 then
  128.        enigma.SendMessage(mir3, "mirror-east", nil)
  129.     end
  130.     mir4=enigma.GetNamedObject("mirror04")
  131.     if switch3 == 1 or switch4 == 1 then
  132.        enigma.SendMessage(mir4, "mirror-south", nil)
  133.     end
  134.     if switch3 == 0 and switch4 == 0 then
  135.        enigma.SendMessage(mir4, "mirror-east", nil)
  136.     end
  137.     mir5=enigma.GetNamedObject("mirror05")
  138.     if switch4 == 1 or switch5 == 1 then
  139.        enigma.SendMessage(mir5, "mirror-west", nil)
  140.     end
  141.     if switch4 == 0 and switch5 == 0 then
  142.        enigma.SendMessage(mir5, "mirror-east", nil)
  143.     end
  144.     mir6=enigma.GetNamedObject("mirror06")
  145.     if switch4 == 1 then
  146.        enigma.SendMessage(mir6, "mirror-west", nil)
  147.     end
  148.     if switch4 == 0 then
  149.        enigma.SendMessage(mir6, "mirror-south", nil)
  150.     end
  151.     mir7=enigma.GetNamedObject("mirror07")
  152.     mir8=enigma.GetNamedObject("mirror08")
  153.     if switch1 == 1 or switch6 == 1 then
  154.        enigma.SendMessage(mir7, "mirror-west", nil)
  155.        enigma.SendMessage(mir8, "mirror-east", nil)
  156.     end
  157.     if switch1 == 0 and switch6 == 0 then
  158.        enigma.SendMessage(mir7, "mirror-south", nil)
  159.        enigma.SendMessage(mir8, "mirror-west", nil)
  160.     end
  161.     mir9 =enigma.GetNamedObject("mirror09")
  162.     mir13=enigma.GetNamedObject("mirror13")
  163.     if switch6 == 1 then
  164.        enigma.SendMessage(mir9,  "mirror-north", nil)
  165.        enigma.SendMessage(mir13, "mirror-west", nil)
  166.     end
  167.     if switch6 == 0 then
  168.        enigma.SendMessage(mir9,  "mirror-west", nil)
  169.        enigma.SendMessage(mir13, "mirror-south", nil)
  170.     end
  171.     mir10=enigma.GetNamedObject("mirror10")
  172.     if switch2 == 1 or switch6 == 1 then
  173.        enigma.SendMessage(mir10, "mirror-south", nil)
  174.     end
  175.     if switch2 == 0 and switch6 == 0 then
  176.        enigma.SendMessage(mir10, "mirror-west", nil)
  177.     end
  178.     mir11=enigma.GetNamedObject("mirror11")
  179.     if switch3 == 1 or switch6 == 1 then
  180.        enigma.SendMessage(mir11, "mirror-north", nil)
  181.     end
  182.     if switch3 == 0 and switch6 == 0 then
  183.        enigma.SendMessage(mir11, "mirror-west", nil)
  184.     end
  185.     mir12=enigma.GetNamedObject("mirror12")
  186.     if switch5 == 1 or switch6 == 1 then
  187.        enigma.SendMessage(mir12, "mirror-east", nil)
  188.     end
  189.     if switch5 == 0 and switch6 == 0 then
  190.        enigma.SendMessage(mir12, "mirror-west", nil)
  191.     end
  192.     mir14=enigma.GetNamedObject("mirror14")
  193.     if switch1 == 1 or switch7 == 1 then
  194.        enigma.SendMessage(mir14, "mirror-south", nil)
  195.     end
  196.     if switch1 == 0 and switch7 == 0 then
  197.        enigma.SendMessage(mir14, "mirror-east", nil)
  198.     end
  199.     mir15=enigma.GetNamedObject("mirror15")
  200.     if switch2 == 1 or switch7 == 1 then
  201.        enigma.SendMessage(mir15, "mirror-west", nil)
  202.     end
  203.     if switch2 == 0 and switch7 == 0 then
  204.        enigma.SendMessage(mir15, "mirror-north", nil)
  205.     end
  206.     mir16=enigma.GetNamedObject("mirror16")
  207.     if switch3 == 1 or switch7 == 1 then
  208.        enigma.SendMessage(mir16, "mirror-east", nil)
  209.     end
  210.     if switch3 == 0 and switch7 == 0 then
  211.        enigma.SendMessage(mir16, "mirror-west", nil)
  212.     end
  213. end
  214.  
  215. function callback1 (ison)
  216.      switch1=ison
  217.      switchaction()
  218. end
  219.  
  220. function callback2 (ison)
  221.      switch2=ison
  222.      switchaction()
  223. end
  224.  
  225. function callback3 (ison)
  226.      switch3=ison
  227.      switchaction()
  228. end
  229.  
  230. function callback4 (ison)
  231.      switch4=ison
  232.      switchaction()
  233. end
  234.  
  235. function callback5 (ison)
  236.      switch5=ison
  237.      switchaction()
  238. end
  239.  
  240. function callback6 (ison)
  241.      switch6=ison
  242.      switchaction()
  243. end
  244.  
  245. function callback7 (ison)
  246.      switch7=ison
  247.      switchaction()
  248. end
  249.  
  250. function callback8 (ison)
  251.      switch8=ison
  252.      switchaction()
  253. end
  254.  
  255. function callback9 (ison)
  256.      switch9=ison
  257.      switchaction()
  258. end