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

  1. --Sven Siggelkow 2003
  2. --Esprit #66
  3.  
  4. levelw = 39
  5. levelh = 37
  6.  
  7. create_world(levelw, levelh)
  8.  
  9. oxyd_default_flavor = "b"
  10. fill_floor("fl-woven", 0, 0, levelw,levelh)
  11. fill_floor("fl-abyss", 10, 13,19 ,11)
  12. set_actor("ac-blackball", 9.5,2.5, {player=0})
  13.  
  14. function renderLine( line, pattern)
  15.     for i=1, strlen(pattern) do
  16.       local c = strsub( pattern, i, i)
  17.       if c == "#" then
  18.          set_stone("st-bluegray",i-1,line)
  19.       elseif c == "h" then
  20.      set_stone("st-bluegray_hole", i-1,line)
  21.       elseif c == "i" then
  22.      set_stone("st-bluegray_hole", i-1,line)
  23.      set_floor("fl-gradient",  i-1,  line, {type=4})
  24.       elseif c == "j" then
  25.      set_stone("st-bluegray_hole", i-1,line)
  26.      set_floor("fl-gradient",  i-1,  line, {type=3})
  27.       elseif c == "w" then
  28.      set_stone("st-bluegray_hole", i-1,line)
  29.      set_item("it-wormhole",i-1,line, {targetx="34.5",targety="33.5",strength=5,range= 0})           --
  30.       elseif c == "W" then
  31.      set_stone("st-bluegray_hole", i-1,line)
  32.      set_item("it-wormhole",i-1,line, {targetx="10.5",targety="11.5",strength=5,range=0})               --
  33.       elseif c == "k" then
  34.      set_stone("st-bluegray_hole", i-1,line)
  35.      set_item("it-key_a",i-1,line)
  36.       elseif c == "l" then
  37.      set_stone("st-key_a", i-1,line, {action="callback", target="door"})
  38.       elseif c == "1" then
  39.          set_item("it-coin",i-1,line,{value=1})
  40.       elseif c == "2" then
  41.          set_item("it-coin",i-1,line,{value=4})
  42.       elseif c == "g" then
  43.          set_stone("st-grate2",i-1,line)
  44.          set_floor("fl-woven",i-1,line)
  45.       elseif c == "n" then
  46.          set_stone("st-grate2",i-1,line)
  47.          set_item("it-coin",i-1,line,{value=1})
  48.          set_floor("fl-woven",i-1,line)
  49.       elseif c == "t" then
  50.          set_stone("st-thief",i-1,line)
  51.       elseif c == "u" then
  52.          set_item("it-umbrella",i-1,line)
  53.       elseif c == "3" then
  54.          set_stone("st-oneway_black-e",i-1,line,{name="3"})
  55.       elseif c == "4" then
  56.          set_stone("st-oneway_black-n",i-1,line,{name="4"})
  57.       elseif c == "5" then
  58.          set_stone("st-oneway_black-e",i-1,line,{name="5"})
  59.       elseif c == "6" then
  60.          set_stone("st-oneway_black-n",i-1,line,{name="6"})
  61.       elseif c == "7" then
  62.          set_stone("st-oneway_black-w",i-1,line,{name="7"})
  63.       elseif c == "8" then
  64.          set_stone("st-oneway_black-w",i-1,line,{name="8"})
  65.       elseif c == "9" then
  66.          set_stone("st-oneway_black-n",i-1,line,{name="9"})
  67.       elseif c == "0" then
  68.          set_stone("st-oneway_black-n",i-1,line,{name="0"})
  69.       elseif c == "a" then
  70.          set_stone("st-oneway_black-n",i-1,line,{name="a"})
  71.       elseif c == "b" then
  72.          set_stone("st-oneway_black-n",i-1,line,{name="b"})
  73.       elseif c == "c" then
  74.          set_stone("st-oneway_black-e",i-1,line,{name="c"})
  75.       elseif c == "d" then
  76.          set_stone("st-oneway_black-s",i-1,line,{name="d"})
  77.       elseif c == "e" then
  78.          set_stone("st-oneway_black-w",i-1,line,{name="e"})
  79.       elseif c == "f" then
  80.          set_stone("st-oneway_black-w",i-1,line,{name="f"})
  81.       elseif c=="A" then
  82.          set_stone("st-coinslot", i-1,line,{target="s3", action="callback"})
  83.       elseif c=="B" then
  84.          set_stone("st-coinslot", i-1,line,{target="s4", action="callback"})
  85.       elseif c=="C" then
  86.          set_stone("st-coinslot", i-1,line,{target="s5", action="callback"})
  87.       elseif c=="D" then
  88.          set_stone("st-coinslot", i-1,line,{target="s6", action="callback"})
  89.       elseif c=="E" then
  90.          set_stone("st-coinslot", i-1,line,{target="s7", action="callback"})
  91.       elseif c=="F" then
  92.          set_stone("st-coinslot", i-1,line,{target="s8", action="callback"})
  93.       elseif c=="G" then
  94.          set_stone("st-coinslot", i-1,line,{target="s9", action="callback"})
  95.       elseif c=="H" then
  96.          set_stone("st-coinslot", i-1,line,{target="s0", action="callback"})
  97.       elseif c=="I" then
  98.          set_stone("st-coinslot", i-1,line,{target="sa", action="callback"})
  99.       elseif c=="J" then
  100.          set_stone("st-coinslot", i-1,line,{target="sb", action="callback"})
  101.       elseif c=="K" then
  102.          set_stone("st-coinslot", i-1,line,{target="sc", action="callback"})
  103.       elseif c=="L" then
  104.          set_stone("st-coinslot", i-1,line,{target="sd", action="callback"})
  105.       elseif c=="M" then
  106.          set_stone("st-coinslot", i-1,line,{target="se", action="callback"})
  107.       elseif c=="N" then
  108.          set_stone("st-coinslot", i-1,line,{target="sf", action="callback"})
  109.       elseif c == "O" then
  110.          oxyd( i-1, line)
  111.         end
  112.     end
  113. end
  114.  
  115. --              012345678901234567890123456789012345678
  116. renderLine(00, "#######################################")
  117. renderLine(01, "#O     1             3               O#")
  118. renderLine(02, "#u                 u A                #")
  119. renderLine(03, "#           1        t                #")
  120. renderLine(04, "#  ######4B#########################  #")
  121. renderLine(05, "#  #O                5            O#  #")
  122. renderLine(06, "#  #                 C             #  #")
  123. renderLine(07, "#  #                 t             #  #")
  124. renderLine(08, "#  #  ########D6#l###############  #  #")
  125. renderLine(09, "#  #  #O hwk         t1        O#  #  #")
  126. renderLine(10, "#  #  #  hhh         E          #  #  #")
  127. renderLine(11, "tijt  #  hhh         7  1       #  #  #")
  128. renderLine(12, "tijt  #  #####################  #  #  #")
  129. renderLine(13, "tijt  #  #      tgt          #  #  #  #")
  130. renderLine(14, "tijt  #  #      tgt          #  #  #  #")
  131. renderLine(15, "tijt  #  #    tttgttttttt    #  #  #  #")
  132. renderLine(16, "tijt  #  #    tngngngngnt    #2 #  #  #")
  133. renderLine(17, "#  #  #  #    tgngngngngt    #  #  #  #")
  134. renderLine(18, "#  F  #9G#    tngngngngnt    #H0#IatbJ#")
  135. renderLine(19, "#  8  #  #    tgngngngngt    #  t  t  #")
  136. renderLine(20, "thht  #  #    tngngngngnt    #  t  t  #")
  137. renderLine(21, "thht  #  #    ttttttttttt    t  #  t  #")
  138. renderLine(22, "thht  #  #                   t  #  #  #")
  139. renderLine(23, "thht  t  #                   #  #  #  #")
  140. renderLine(24, "thht  #  #####################  #  #  #")
  141. renderLine(25, "thht  #              c          #  #  #")
  142. renderLine(26, "#  #  #              K          #  #  #")
  143. renderLine(27, "#  #  #O    1       1t    1    O#  #  #")
  144. renderLine(28, "#  #  ###########ttt#########dL##  #  #")
  145. renderLine(29, "#  #                 e             #  #")
  146. renderLine(30, "#  #                 M             #  #")
  147. renderLine(31, "#  #O 1      1       t 1          O#  #")
  148. renderLine(32, "#  #################################  #")
  149. renderLine(33, "#                    f           hhh  #")
  150. renderLine(34, "#                    N           hhh  #")
  151. renderLine(35, "#O     1       1     t           hWh O#")
  152. renderLine(36, "#######################################")
  153. --              012345678901234567890123456789012345678
  154.  
  155.  
  156. oxyd_shuffle()
  157.  
  158. --             > ^ > ^ < < ^ ^ ^ ^ > v < <
  159. --             3 4 5 6 7 8 9 0 a b c d e f door
  160. local flags = {0,0,0,0,1,1,0,0,0,0,0,1,1,1,0}
  161. --             1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  162.  
  163. function door()
  164. %flags[15] = 1 - %flags[15]
  165. if %flags[15] == 0 then
  166.     set_stone("st-bluegray",17,12)
  167.     else
  168.     enigma.KillStone(17,12)
  169. end
  170. end
  171.  
  172. function s3()
  173. %flags[1] = 1 - %flags[1]
  174. if %flags[1] == 0 then
  175.     enigma.SendMessage(enigma.GetNamedObject("3"),"direction",EAST)
  176.     else
  177.     enigma.SendMessage(enigma.GetNamedObject("3"),"direction",WEST)
  178. end
  179. end
  180.  
  181. function s4()
  182. %flags[2] = 1 - %flags[2]
  183. if %flags[2] == 0 then
  184.     enigma.SendMessage(enigma.GetNamedObject("4"),"direction",NORTH)
  185.     else
  186.     enigma.SendMessage(enigma.GetNamedObject("4"),"direction",SOUTH)
  187. end
  188. end
  189.  
  190. function s5()
  191. %flags[3] = 1 - %flags[3]
  192. if %flags[3] == 0 then
  193.     enigma.SendMessage(enigma.GetNamedObject("5"),"direction",EAST)
  194.     else
  195.     enigma.SendMessage(enigma.GetNamedObject("5"),"direction",WEST)
  196. end
  197. end
  198.  
  199. function s6()
  200. %flags[4] = 1 - %flags[4]
  201. if %flags[4] == 0 then
  202.     enigma.SendMessage(enigma.GetNamedObject("6"),"direction",NORTH)
  203.     else
  204.     enigma.SendMessage(enigma.GetNamedObject("6"),"direction",SOUTH)
  205. end
  206. end
  207.  
  208. function s7()
  209. %flags[5] = 1 - %flags[5]
  210. if %flags[5] == 0 then
  211.     enigma.SendMessage(enigma.GetNamedObject("7"),"direction",EAST)
  212.     else
  213.     enigma.SendMessage(enigma.GetNamedObject("7"),"direction",WEST)
  214. end
  215. end
  216.  
  217. function s8()
  218. %flags[6] = 1 - %flags[6]
  219. if %flags[6] == 0 then
  220.     enigma.SendMessage(enigma.GetNamedObject("8"),"direction",EAST)
  221.     else
  222.     enigma.SendMessage(enigma.GetNamedObject("8"),"direction",WEST)
  223. end
  224. end
  225.  
  226. function s9()
  227. %flags[7] = 1 - %flags[7]
  228. if %flags[7] == 0 then
  229.     enigma.SendMessage(enigma.GetNamedObject("9"),"direction",NORTH)
  230.     else
  231.     enigma.SendMessage(enigma.GetNamedObject("9"),"direction",SOUTH)
  232. end
  233. end
  234.  
  235. function s0()
  236. %flags[8] = 1 - %flags[8]
  237. if %flags[8] == 0 then
  238.     enigma.SendMessage(enigma.GetNamedObject("0"),"direction",NORTH)
  239.     else
  240.     enigma.SendMessage(enigma.GetNamedObject("0"),"direction",SOUTH)
  241. end
  242. end
  243.  
  244. function sa()
  245. %flags[9] = 1 - %flags[9]
  246. if %flags[9] == 0 then
  247.     enigma.SendMessage(enigma.GetNamedObject("a"),"direction",NORTH)
  248.     else
  249.     enigma.SendMessage(enigma.GetNamedObject("a"),"direction",SOUTH)
  250. end
  251. end
  252.  
  253. function sb()
  254. %flags[10] = 1 - %flags[10]
  255. if %flags[10] == 0 then
  256.     enigma.SendMessage(enigma.GetNamedObject("b"),"direction",NORTH)
  257.     else
  258.     enigma.SendMessage(enigma.GetNamedObject("b"),"direction",SOUTH)
  259. end
  260. end
  261.  
  262. function sc()
  263. %flags[11] = 1 - %flags[11]
  264. if %flags[11] == 0 then
  265.     enigma.SendMessage(enigma.GetNamedObject("c"),"direction",EAST)
  266.     else
  267.     enigma.SendMessage(enigma.GetNamedObject("c"),"direction",WEST)
  268. end
  269. end
  270.  
  271. function sd()
  272. %flags[12] = 1 - %flags[12]
  273. if %flags[12] == 0 then
  274.     enigma.SendMessage(enigma.GetNamedObject("d"),"direction",NORTH)
  275.     else
  276.     enigma.SendMessage(enigma.GetNamedObject("d"),"direction",SOUTH)
  277. end
  278. end
  279.  
  280. function se()
  281. %flags[13] = 1 - %flags[13]
  282. if %flags[13] == 0 then
  283.     enigma.SendMessage(enigma.GetNamedObject("e"),"direction",EAST)
  284.     else
  285.     enigma.SendMessage(enigma.GetNamedObject("e"),"direction",WEST)
  286. end
  287. end
  288.  
  289.  
  290. function sf()
  291. %flags[14] = 1 - %flags[14]
  292. if %flags[14] == 0 then
  293.     enigma.SendMessage(enigma.GetNamedObject("f"),"direction",EAST)
  294.     else
  295.     enigma.SendMessage(enigma.GetNamedObject("f"),"direction",WEST)
  296. end
  297. end
  298.