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

  1. --Siegfried Fennig 09.07.2003 Rev.0
  2.  
  3. levelw = 58
  4. levelh = 13
  5.  
  6. create_world(levelw, levelh)
  7. enigma.ConserveLevel = FALSE
  8. oxyd_default_flavor = "d"
  9. fill_floor("fl-rough", 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 == "+" then
  15.          set_stone("st-rock3_break",i-1,line)
  16.       elseif c == "r" then
  17.          set_stone("st-blue-sand",i-1,line)
  18.       elseif c == "*" then
  19.          set_stone("st-grate1",i-1,line)
  20.       elseif c == "#" then
  21.          fill_floor("fl-abyss", i-1,line, 1,1)
  22.       elseif c == "A" then
  23.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door13"})
  24.       elseif c == "a" then
  25.          doorv( i-1,line, {name="door13"})
  26.       elseif c == "C" then
  27.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door14"})
  28.       elseif c == "c" then
  29.          doorv( i-1,line, {name="door14"})
  30.       elseif c == "D" then
  31.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door15"})
  32.       elseif c == "d" then
  33.          doorv( i-1,line, {name="door15"})
  34.       elseif c == "E" then
  35.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door16"})
  36.       elseif c == "e" then
  37.          doorv( i-1,line, {name="door16"})
  38.       elseif c == "I" then
  39.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door17"})
  40.       elseif c == "i" then
  41.          doorv( i-1,line, {name="door17"})
  42.       elseif c == "J" then
  43.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door18"})
  44.       elseif c == "j" then
  45.          doorv( i-1,line, {name="door18"})
  46.       elseif c == "K" then
  47.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door19"})
  48.       elseif c == "k" then
  49.          doorh( i-1,line, {name="door19"})
  50.       elseif c == "L" then
  51.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door20"})
  52.       elseif c == "l" then
  53.          doorh( i-1,line, {name="door20"})
  54.       elseif c == "M" then
  55.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door21"})
  56.       elseif c == "m" then
  57.          doorh( i-1,line, {name="door21"})
  58.       elseif c == "N" then
  59.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door22"})
  60.       elseif c == "n" then
  61.          doorh( i-1,line, {name="door22"})
  62.       elseif c == "P" then
  63.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door23"})
  64.       elseif c == "p" then
  65.          doorh( i-1,line, {name="door23"})
  66.       elseif c == "Q" then
  67.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door24"})
  68.       elseif c == "q" then
  69.          doorh( i-1,line, {name="door24"})
  70.       elseif c == "S" then
  71.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door25"})
  72.       elseif c == "s" then
  73.          doorh( i-1,line, {name="door25"})
  74.       elseif c == "T" then
  75.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door26"})
  76.       elseif c == "t" then
  77.          doorh( i-1,line, {name="door26"})
  78.       elseif c == "U" then
  79.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door27"})
  80.       elseif c == "u" then
  81.          doorh( i-1,line, {name="door27"})
  82.       elseif c == "V" then
  83.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door28"})
  84.       elseif c == "v" then
  85.          doorh( i-1,line, {name="door28"})
  86.       elseif c == "W" then
  87.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door29"})
  88.       elseif c == "w" then
  89.          doorh( i-1,line, {name="door29"})
  90.       elseif c == "X" then
  91.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door30"})
  92.       elseif c == "x" then
  93.          doorh( i-1,line, {name="door30"})
  94.       elseif c == "Y" then
  95.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door31"})
  96.       elseif c == "y" then
  97.          doorv( i-1,line, {name="door31"})
  98.       elseif c == "Z" then
  99.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door32"})
  100.       elseif c == "z" then
  101.          doorv( i-1,line, {name="door32"})
  102.       elseif c == "G" then
  103.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door33"})
  104.       elseif c == "g" then
  105.          doorv( i-1,line, {name="door33"})
  106.       elseif c == "F" then
  107.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door34"})
  108.       elseif c == "f" then
  109.          doorv( i-1,line, {name="door34"})
  110.       elseif c == "B" then
  111.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door35"})
  112.       elseif c == "b" then
  113.          doorv( i-1,line, {name="door35"})
  114.       elseif c == "O" then
  115.          set_stone("st-coinslot", i-1,line, {action="openclose", target="door36"})
  116.       elseif c == "o" then
  117.          doorv( i-1,line, {name="door36"})
  118.       elseif c == "(" then
  119.          set_item("it-vortex-closed", i-1,line)
  120.       elseif c == "4" then
  121.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback1"})
  122.       elseif c == "5" then
  123.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback2"})
  124.       elseif c == "6" then
  125.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback3"})
  126.       elseif c == "7" then
  127.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback4"})
  128.       elseif c == "8" then
  129.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback5"})
  130.       elseif c == "9" then
  131.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback6"})
  132.       elseif c == "3" then
  133.          set_stone("st-timeswitch",i-1,line, {action="callback", target="callback7"})
  134.       elseif c == ")" then
  135.          set_item("it-vortex-closed", i-1,line, {targetx = 18.5, targety =  11.5, name="vortex1"})
  136.       elseif c == "1" then
  137.          set_item("it-coin", i-1,line, {value=1})
  138.       elseif c == "2" then
  139.          set_item("it-coin", i-1,line, {value=6})
  140.       elseif c == "?" then
  141.          set_item("it-hammer", i-1,line)
  142.       elseif c == ":" then
  143.          set_item("it-key_a",i-1,line)
  144.       elseif c == ";" then
  145.          set_stone("st-key_a",i-1,line, {action="openclose", target="door37"})
  146.       elseif c == "," then
  147.          doorh( i-1,line, {name="door37"})
  148.       elseif c == "%" then
  149.          set_stone("st-door",i-1,line, {name="door38",  type="v"})
  150.       elseif c == "&" then
  151.         set_stone("st-door",i-1,line, {name="door39",  type="v"})
  152.       elseif c == "-" then
  153.          oxyd( i-1, line)
  154.       elseif c == "=" then
  155.          document(i-1,line,"You really will need every penny!")
  156.       elseif c == "!" then
  157.          set_actor("ac-blackball", i-.5,line+.5, {player=0})
  158.         end
  159.     end
  160. end
  161. --                        1         2         3         4         5
  162. --              0123456789012345678901234567890123456789012345678901234567
  163. renderLine(00, "rrrrrrrrrrrrrrrrrrrr##################rrrrrrrrrrrrrrrrrrrr")
  164. renderLine(01, "r+++             r r##################r  rr  D  e  I  j  r")
  165. renderLine(02, "r+-+    2        r r##################r  rr  d  E  i  J  r")
  166. renderLine(03, "r+++  1          r r##################r  rr  r  r  rLlrMmr")
  167. renderLine(04, "r         1      r r##################r  Ar  r  rKkr? r  r")
  168. renderLine(05, "r              45r 8rrrrrrrrrrrrrrrrrrr  a   rPp3) r  r  r")
  169. renderLine(06, "r !  1         %   & **            **** =rrNnY  z  GQqrsSr")
  170. renderLine(07, "r              67r 9rrrrrrrrrrrrrrrrrrr  c   y  Z  g  r  r")
  171. renderLine(08, "r     1   1 1    r,r##################r  CrtTrUurvVr  r  r")
  172. renderLine(09, "r+++             ; r##################r  rr  r  r  rwWrXxr")
  173. renderLine(10, "r+-+   1 1   1   r r##################r  rr  F  b    o   r")
  174. renderLine(11, "r+++             r(r##################r  rr  f  B    O  :r")
  175. renderLine(12, "rrrrrrrrrrrrrrrrrrrr##################rrrrrrrrrrrrrrrrrrrr")
  176. --              0123456789012345678901234567890123456789012345678901234567
  177. --                        1         2         3         4         5
  178.  
  179. oxyd_shuffle()
  180.  
  181. set_stone( "st-timer", 27, 8, {action="callback", target="t_h1"})
  182. set_stone( "st-timer", 28, 8, {action="callback", target="t_h2"})
  183. set_stone( "st-timer", 29, 8, {action="callback", target="t_h3"})
  184.  
  185. timer = 0
  186.  
  187. function t_h1()
  188.     doora=enigma.GetNamedObject("door1")
  189.     doorb=enigma.GetNamedObject("door2")
  190.     doorc=enigma.GetNamedObject("door3")
  191.     doord=enigma.GetNamedObject("door4")
  192.  
  193.     if timer == 0 then
  194.         enigma.SendMessage(doora, "open", nil)
  195.      end
  196.     if timer == 1 then
  197.         enigma.SendMessage(doorb, "open", nil)
  198.     end
  199.     if timer == 2 then
  200.         enigma.SendMessage(doorc, "open", nil)
  201.     end
  202.     if timer == 3 then
  203.         enigma.SendMessage(doord, "open", nil)
  204.         enigma.SendMessage(doora, "close", nil)
  205.     end
  206.     if timer == 4 then
  207.         enigma.SendMessage(doorb, "close", nil)
  208.     end
  209.     if timer == 5 then
  210.         enigma.SendMessage(doorc, "close", nil)
  211.     end
  212.     if timer == 6 then
  213.         enigma.SendMessage(doord, "close", nil)
  214.     end
  215. end
  216.  
  217. function t_h2()
  218.     doora=enigma.GetNamedObject("door5")
  219.     doorb=enigma.GetNamedObject("door6")
  220.     doorc=enigma.GetNamedObject("door7")
  221.     doord=enigma.GetNamedObject("door8")
  222.  
  223.     if timer == 4 then
  224.         enigma.SendMessage(doora, "open", nil)
  225.     end
  226.     if timer == 5 then
  227.         enigma.SendMessage(doorb, "open", nil)
  228.     end
  229.     if timer == 6 then
  230.         enigma.SendMessage(doorc, "open", nil)
  231.     end
  232.     if timer == 7 then
  233.         enigma.SendMessage(doord, "open", nil)
  234.         enigma.SendMessage(doora, "close", nil)
  235.     end
  236.     if timer == 8 then
  237.         enigma.SendMessage(doorb, "close", nil)
  238.     end
  239.     if timer == 9 then
  240.         enigma.SendMessage(doorc, "close", nil)
  241.     end
  242.     if timer == 10 then
  243.         enigma.SendMessage(doord, "close", nil)
  244.     end
  245. end
  246.  
  247. function t_h3()
  248.     doora=enigma.GetNamedObject("door9")
  249.     doorb=enigma.GetNamedObject("door10")
  250.     doorc=enigma.GetNamedObject("door11")
  251.     doord=enigma.GetNamedObject("door12")
  252.  
  253.     if timer == 8 then
  254.         enigma.SendMessage(doora, "open", nil)
  255.     end
  256.     if timer == 9 then
  257.         enigma.SendMessage(doorb, "open", nil)
  258.     end
  259.     if timer == 10 then
  260.         enigma.SendMessage(doorc, "open", nil)
  261.     end
  262.     if timer == 11 then
  263.         enigma.SendMessage(doord, "open", nil)
  264.         enigma.SendMessage(doora, "close", nil)
  265.     end
  266.     if timer == 0 then
  267.         enigma.SendMessage(doorb, "close", nil)
  268.     end
  269.     if timer == 1 then
  270.         enigma.SendMessage(doorc, "close", nil)
  271.     end
  272.     if timer == 2 then
  273.         enigma.SendMessage(doord, "close", nil)
  274.     end
  275.  
  276.     timer = timer + 1
  277.     if timer == 12 then
  278.         timer = 0
  279.     end
  280. end
  281.  
  282. set_stone("st-door_a", 23, 6, {name="door1",  type="v"})
  283. set_stone("st-door_a", 24, 6, {name="door2",  type="v"})
  284. set_stone("st-door_a", 25, 6, {name="door3",  type="v"})
  285. set_stone("st-door_a", 26, 6, {name="door4",  type="v"})
  286. set_stone("st-door_a", 27, 6, {name="door5",  type="v"})
  287. set_stone("st-door_a", 28, 6, {name="door6",  type="v"})
  288. set_stone("st-door_a", 29, 6, {name="door7",  type="v"})
  289. set_stone("st-door_a", 30, 6, {name="door8",  type="v"})
  290. set_stone("st-door_a", 31, 6, {name="door9",  type="v"})
  291. set_stone("st-door_a", 32, 6, {name="door10", type="v"})
  292. set_stone("st-door_a", 33, 6, {name="door11", type="v"})
  293. set_stone("st-door_a", 34, 6, {name="door12", type="v"})
  294.  
  295. switch1 = 0
  296. switch2 = 0
  297. switch3 = 0
  298. switch4 = 0
  299. switch5 = 0
  300. switch6 = 0
  301. switch7 = 0
  302.  
  303. function switchaction()
  304.     doorx=enigma.GetNamedObject("door38")
  305.     if switch1 == 1 or switch2 == 1 or
  306.        switch3 == 1 or switch4 == 1 then
  307.        enigma.SendMessage(doorx, "open", nil)
  308.     end
  309.     if switch1 == 0 and switch2 == 0 and
  310.        switch3 == 0 and switch4 == 0  then
  311.        enigma.SendMessage(doorx, "close", nil)
  312.     end
  313.     doory=enigma.GetNamedObject("door39")
  314.     if switch5 == 1 or switch6 == 1 then
  315.        enigma.SendMessage(doory, "open", nil)
  316.     end
  317.     if switch5 == 0 and switch6 == 0 then
  318.        enigma.SendMessage(doory, "close", nil)
  319.     end
  320.     vortexa=enigma.GetNamedObject("vortex1")
  321.     if switch7 == 1 then
  322.        enigma.SendMessage(vortexa, "open", nil)
  323.     end
  324.     if switch7 == 0 then
  325.        enigma.SendMessage(vortexa, "close", nil)
  326.     end
  327. end
  328.  
  329. function callback1 (ison)
  330.      switch1=ison
  331.      switchaction()
  332. end
  333.  
  334. function callback2 (ison)
  335.      switch2=ison
  336.      switchaction()
  337. end
  338.  
  339. function callback3 (ison)
  340.      switch3=ison
  341.      switchaction()
  342. end
  343.  
  344. function callback4 (ison)
  345.      switch4=ison
  346.      switchaction()
  347. end
  348.  
  349. function callback5 (ison)
  350.      switch5=ison
  351.      switchaction()
  352. end
  353.  
  354. function callback6 (ison)
  355.      switch6=ison
  356.      switchaction()
  357. end
  358.  
  359. function callback7 (ison)
  360.      switch7=ison
  361.      switchaction()
  362. end
  363.