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

  1. levelw=100
  2. levelh=60
  3.  
  4. create_world( levelw, levelh)
  5.  
  6. fill_floor("fl-rough", 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 =="w" then
  14.             set_stone( "st-glass", i-1, line)
  15.         elseif c =="m" then
  16.             set_stone( "st-brick", i-1, line)
  17.         elseif c =="B" then
  18.             set_stone( "st-brownie", i-1, line)
  19.         elseif c =="R" then
  20.             set_stone( "st-rock6", i-1, line)
  21.         elseif c =="x" then
  22.             set_stone( "st-rock5", i-1, line)
  23.         elseif c =="n" then
  24.             set_stone( "st-rock4", i-1, line)
  25.         elseif c =="v" then
  26.             set_stone( "st-rock3", i-1, line)
  27.         elseif c ==";" then
  28.             set_stone( "st-rock2", i-1, line)
  29.         elseif c =="/" then
  30.             set_stone( "st-rock1", i-1, line)
  31.         elseif c =="H" then
  32.             set_stone( "st-bluegray", i-1, line)
  33. elseif c=="t" then
  34.    set_stone( "st-actorimpulse",i-1,line)
  35.         elseif c == "o" then
  36.             oxyd( i-1, line)
  37.              elseif c == "!" then
  38.             abyss(i-1,line)
  39. --            fill_floor("fl-water", i-1,line, 1,1)
  40.         elseif c=="+" then
  41.             set_stone( "st-wood", i-1, line)
  42.              elseif c == "=" then
  43.             fill_floor("fl-space", i-1,line, 1,1)
  44.         elseif c=="z" then
  45. set_actor("ac-blackball", i-.5,line+.5, {player=0})
  46. set_item("it-yinyang",i-1,line)
  47.         elseif c=="y" then
  48. set_actor("ac-whiteball", i-.5,line+.5, {player=1})
  49. set_item("it-yinyang",i-1,line)
  50.         elseif c == "d" then --1-d
  51.             set_floor("fl-gradient",  i-1,  line, {type=1})
  52.         elseif c == "u" then --2-u
  53.             set_floor("fl-gradient",  i-1,  line, {type=2})
  54.         elseif c == "r" then --3-r
  55.                 set_floor("fl-gradient",  i-1,  line, {type=3})
  56.         elseif c == "l" then --4-l
  57.                 set_floor("fl-gradient",  i-1,  line, {type=4})
  58.         elseif c == "1" then --ur
  59.             set_floor("fl-gradient",  i-1,  line, {type=11})
  60.         elseif c == "3" then --dl
  61.             set_floor("fl-gradient",  i-1,  line, {type=9})
  62.         elseif c == "7" then --dr
  63.             set_floor("fl-gradient",  i-1,  line, {type=12})
  64.         elseif c == "9" then --ul
  65.             set_floor("fl-gradient",  i-1,  line, {type=10})
  66.         elseif c=="S" then
  67.             oneway(i-1,line, enigma.SOUTH)
  68.         elseif c=="N" then
  69.             oneway(i-1,line, enigma.NORTH)
  70.         elseif c=="E" then
  71.             oneway(i-1,line, enigma.EAST)
  72.     elseif c=="W" then
  73.             oneway(i-1,line, enigma.WEST)
  74.         elseif c=="g" then
  75.            draw_stones("st-grate1",{i-1,line}, {1,1}, 1)
  76.         elseif c == "X" then
  77.                  draw_stones("st-yinyang1", { i-1,line}, {0,1},1)
  78.         elseif c=="a" then
  79.             set_floor("fl-bridge", i-1,line, {name="bridge1", type="x"})
  80.         elseif c=="b" then
  81.             set_floor("fl-bridge", i-1,line, {name="bridge2", type="x"})
  82.         elseif c=="c" then
  83.             set_floor("fl-bridge", i-1,line, {name="bridge3", type="x"})
  84.         elseif c=="D" then
  85.             set_floor("fl-bridge", i-1,line, {name="bridge4", type="x"})
  86.         elseif c=="e" then
  87.             set_floor("fl-bridge", i-1,line, {name="bridge5", type="x"})
  88.         elseif c=="f" then
  89.             set_floor("fl-bridge", i-1,line, {name="bridge6", type="x"})
  90.         elseif c=="G" then
  91.             set_floor("fl-bridge", i-1,line, {name="bridge7", type="x"})
  92.         elseif c=="h" then
  93.             set_floor("fl-bridge", i-1,line, {name="bridge8", type="x"})
  94.         elseif c=="i" then
  95.             set_floor("fl-bridge", i-1,line, {name="bridge9", type="x"})
  96.         elseif c=="j" then
  97.             set_floor("fl-bridge", i-1,line, {name="bridge10", type="x"})
  98.     elseif c=="`" then
  99.              set_item("it-wormhole", i-1, line, {strength=1,targetx="59.5",targety="22.5", name="ww1"})
  100.     elseif c=="@" then
  101.        set_item("it-wormhole", i-1, line, {strength=1,targetx="40.5",targety="26.5", name="ww2"})
  102.     elseif c=="~" then
  103.        set_item("it-wormhole", i-1, line, {strength=1,targetx="2.5",targety="14.5", name="ww3"})
  104.     elseif c=="$" then
  105.        set_item("it-wormhole", i-1, line, {strength=1,targetx="10",targety="42.5", name="ww4"})
  106.     elseif c=="%" then
  107.        set_item("it-wormhole", i-1, line, {strength=1,targetx="74.5",targety="46.5", name="ww5"})
  108.     elseif c=="^" then
  109.        set_item("it-wormhole", i-1, line, {strength=1,targetx="71.5",targety="6.5", name="ww6"})
  110.     elseif c=="&" then
  111.        set_item("it-wormhole", i-1, line, {strength=1,targetx="49",targety="30.5", name="ww7"})
  112.     elseif c=="8" then
  113.        set_item("it-wormhole", i-1, line, {strength=1,targetx="48.5",targety="40.5", name="ww8"})
  114.     elseif c=="p" then
  115.        set_item("it-wormhole", i-1, line, {strength=7,targetx="71.5",targety="6.5"})
  116.     elseif c=="0" then
  117.        set_item("it-wormhole", i-1, line, {strength=8,targetx="59.5",targety="15.5"})
  118.     elseif c=="q" then
  119.        set_item("it-wormhole", i-1, line, {strength=1,targetx="37.5",targety="25.5"})
  120.         elseif c=="V" then
  121.             set_stone("st-switch", i-1,line, {action="callback",target="funcc"})
  122.         elseif c=="F" then
  123.             set_item("it-trigger", i-1,line, {action="callback", target="changewormholes"})
  124.         end
  125.     end    
  126. end
  127.  
  128. -- Floor:  " "
  129. -- Border: "#"
  130. -- Oxyd:   "o"
  131.  
  132. renderLine(00,";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;")
  133. renderLine(01,";ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg;")
  134. renderLine(02,";g;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;g;")
  135. renderLine(03,";g;   ;;       ;   ;        ;                 ;            p         ;    ;g;")
  136. renderLine(04,";g;            ;      ;;    ;                 ;           ;;;;;;     ;    ;g;")
  137. renderLine(05,";g;    p ;         ;          p;              ;                ; ;;;;;    ;g;")
  138. renderLine(06,";g;  ;;    ;;  ;   p     ;  ;  ;       p      ;                ;   p      ;g;")
  139. renderLine(07,";g;      ;     ;     ;;  ;  ;  ;              ;                ; ;;;;;    ;g;")
  140. renderLine(08,";g; q    ;  p  ;   ;     ;                                ;;;;;;     ;    ;g;")
  141. renderLine(09,";g;o     ;         ;     ;                                 p         ;    ;g;")
  142. renderLine(10,";g;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;g;")
  143. renderLine(11,";ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg;")
  144. renderLine(12,"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxBBBBBBBBBBBBBBBBBBBwwwwwwwwwwwwwwwwwwww")
  145. renderLine(13,"x   lllrrrrllrll   xog g g g g g g g gBo                 w                 0w")
  146. renderLine(14,"x   lllrrrrllrll   xggggggggggggggggggBggggggggggggggggg w    w        0    w")
  147. renderLine(15,"x   lllrrrrllrll   xg                gBg              qg w    w             w")
  148. renderLine(16,"xxxxxxxxxxxxxxxxxxuxg gggggggggggggg gBg ggggggggggggg g wo   w    0        w")
  149. renderLine(17,"x rrrlllrrrrll1x   xg g            g gBg g           g g wwwwww        0   0w")
  150. renderLine(18,"xuxxxxxxxxxxxxlxdxxxg g gggggggggg g gBg g ggggg ggg g g w           0      w")
  151. renderLine(19,"xdx lllrrllrll7xdx  g g            g gBg g g   g g g g g w***** w0        0 w")
  152. renderLine(20,"xux xxxxxxxxxxxxdxdxg gggggggggggggg gBg g ggg g g ggg g w    * w  0    0   w")
  153. renderLine(21,"xdx llllllllllll7xdxg                gBg gg  g g g     g w    * w     0   0 w")
  154. renderLine(22,"xuxxxxxxxxxxxxxxxx xggggggggggggggggggBgg gggg g ggggggg w    * w 0   q     w")
  155. renderLine(23,"x lrlrlrlrlrlrlrlr xg g g g g g g g g B g      g         w    * w   0    0  w")
  156. renderLine(24,"########################SS#############RRRRRRddddddRRRRRRwwwwwwwwwwwwwwwwwwww")
  157. renderLine(25,"#oX X X Xa   #                 #rrrrr #     R======R     m                  m")
  158. renderLine(26,"#XX X X Xb z #                 #rrrr9u#     RddddddR     m mmmmmmmmmmmmmmmm m")
  159. renderLine(27,"#   X X Xc   #                 #rrr9uu#     R======R     m mq             m m")
  160. renderLine(28,"#XXXX X XD   #                 #rr9uuu#     RddddddR     m mmmmmmmmmmmmmo m m")
  161. renderLine(29,"#     X Xe   #                 #r9uuuu#     R      R     m                m m")
  162. renderLine(30,"##########   E  V              g9uuuuu#     R      R=====mmmmmmmmmmmmmmmmmm m")
  163. renderLine(31,"#     X Xf   #                 #g######     R      R=====m                  m")
  164. renderLine(32,"#XXXX X XG   #                        #     RRRRRRRR=====m mmmmmmmmmmmmmmmmmm")
  165. renderLine(33,"#   X X Xh   #                        #     lllll ====H==m                  m")
  166. renderLine(34,"#XX X X Xi y #                        #     lllll ====H==mmmmmmmmmmmmmmmmmm m")
  167. renderLine(35,"#oX X X Xj   #                        #     lllll ====H==                   m")
  168. renderLine(36,"####################                  #HHHHHHHHHHHHHHHHHHmmmmmmmmmmmmmmmmmmmm")
  169. renderLine(37,"/qddddddddddddddddq#                  #   v       v      v        t   t     t")
  170. renderLine(38,"/r3dddddddddddddd1l#                  # v vvvvvvv vv vvv vtt tt t t t   ttt t")
  171. renderLine(39,"/rr7uuuuuuuuuuuu9ll#                  # v v  v     v   v v t  t t ttttt t t t")
  172. renderLine(40,"/rrl3dddddddddd1rll#                  # v v vv v v v vvv v tttt t    t  t t t")
  173. renderLine(41,"/rrlr7uuuuuuuu9lrll#                  # v      vvv v v   v    t tttt t tt   t") 
  174. renderLine(42,"/rrlrl        rlrll#                  # vvvvvv     v v vvv tt t t t    t  ttt")
  175. renderLine(43,"/rrlr1dddddddd3lrll#                  #      vvvvvvv v   v t  t t t tttt tt t")
  176. renderLine(44,"/rrl9uuuuuuuuuu7rll#                  #vvvvv   v   v vvo v t tt t ttt     t t")
  177. renderLine(45,"/rr1dddddddddddd3ll#                  #      v   v   v   v t  t     ttttt   t")
  178. renderLine(46,"or9uuuuuuuuuuuuuu7l#                  #vvvvvvvvvvvvvvvSvvv tt tttt tt t     t")
  179. renderLine(47,"/quuuuuuuuuuuuuuuuq#    q`@~$%^&8q    W                  W ot       t       t")
  180. renderLine(48,"///////////////////####################vvvvvvvvvvvvvvvvvvvttttttttttttttttttt")
  181.  
  182. oxyd_shuffle()
  183.  
  184. set_floor("fl-gradient",  1,  37, {type=9})
  185. set_floor("fl-gradient",  1,  47, {type=10})
  186. set_floor("fl-gradient",  18,  37, {type=11})
  187. set_floor("fl-gradient",  18,  47, {type=12})
  188.  
  189.  
  190. bridge1=enigma.GetNamedObject("bridge1")
  191. bridge2=enigma.GetNamedObject("bridge2")
  192. bridge3=enigma.GetNamedObject("bridge3")
  193. bridge4=enigma.GetNamedObject("bridge4")
  194. bridge5=enigma.GetNamedObject("bridge5")
  195. bridge6=enigma.GetNamedObject("bridge6")
  196. bridge7=enigma.GetNamedObject("bridge7")
  197. bridge8=enigma.GetNamedObject("bridge8")
  198. bridge9=enigma.GetNamedObject("bridge9")
  199. bridge10=enigma.GetNamedObject("bridge10")
  200.  
  201. through=0
  202. function funcc()
  203.     if through==1 then
  204.     through=0
  205.     end
  206.    if through==0 then
  207.     enigma.SendMessage(bridge1, "openclose", nil)
  208.     enigma.SendMessage(bridge2, "openclose", nil)
  209.     enigma.SendMessage(bridge3, "openclose", nil)
  210.     enigma.SendMessage(bridge4, "openclose", nil)
  211.     enigma.SendMessage(bridge5, "openclose", nil)
  212.     enigma.SendMessage(bridge6, "openclose", nil)
  213.     enigma.SendMessage(bridge7, "openclose", nil)
  214.     enigma.SendMessage(bridge8, "openclose", nil)
  215.     enigma.SendMessage(bridge9, "openclose", nil)
  216.     enigma.SendMessage(bridge10, "openclose", nil)
  217.    end
  218.     through=through+1
  219. end
  220.  
  221. --through2=0
  222. --function changewormholes()
  223. --if through2==1 then
  224. --through2=0
  225. --end
  226. --if through2==0 then
  227. --rrr= random(1,8)
  228. --if rrr==1 then
  229. --tx=59.5
  230. --ty=22.5
  231. --end
  232. --if rrr==2 then
  233. --tx=41.5
  234. --ty=26.5
  235. --end
  236. --if rrr==3 then
  237. --tx=2.5
  238. --ty=14.5
  239. --end
  240. --if rrr==4 then
  241. --tx=10
  242. --ty=42.5
  243. --end
  244. --if rrr==5 then
  245. --tx=76.5
  246. --ty=46.5
  247. --end
  248. --if rrr==6 then
  249. --tx=71.5
  250. --ty=6.5
  251. --end
  252. --if rrr==7 then
  253. --tx=49
  254. --ty=30.5
  255. --end
  256. --if rrr==8 then
  257. --tx=48.5
  258. --ty=41.5
  259. --end
  260. --       SetAttrib(ww1, "targetx", tx)
  261. --       SetAttrib(ww1, "targety", ty)
  262. --       SetAttrib(ww2, "targetx", tx)
  263. --       SetAttrib(ww2, "targety", ty)
  264. --         set_item("it-wormhole", 26+w1, 47, {strength=1,targetx="59.5",targety="22.5"})
  265. --       set_item("it-wormhole", 26+w2, 47, {strength=1,targetx="41.5",targety="26.5"})
  266. --       set_item("it-wormhole", 26+w3, 47, {strength=1,targetx="2.5",targety="14.5"})
  267. --       set_item("it-wormhole", 26+w4, 47, {strength=1,targetx="10",targety="42.5"})
  268. --       set_item("it-wormhole", 26+w5, 47, {strength=1,targetx="76.5",targety="46.5"})
  269. --       set_item("it-wormhole", 26+w6, 47, {strength=1,targetx="71.5",targety="6.5"})
  270. --       set_item("it-wormhole", 26+w7, 47, {strength=1,targetx="49",targety="30.5"})
  271. --       set_item("it-wormhole", 26+w8, 47, {strength=1,targetx="48.5",targety="41.5"})
  272. --end      
  273. --end