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

  1. levelw=100
  2. levelh=50
  3.  
  4. create_world( levelw, levelh)
  5.  
  6. fill_floor("fl-bluegreen", 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 == "o" then
  16.             oxyd( i-1, line)
  17.         elseif c=="z" then
  18.            set_actor("ac-blackball", i-.5,line+.5, {player=0})
  19. elseif c=="a" then
  20. set_item("it-trigger", i-1,line, {action="callback", target="funcc1"})
  21. elseif c=="b" then
  22. set_item("it-trigger", i-1,line, {action="callback", target="funcc2"})
  23. elseif c=="c" then
  24. set_item("it-trigger", i-1,line, {action="callback", target="funcc3"})
  25. elseif c=="d" then
  26. set_item("it-trigger", i-1,line, {action="callback", target="funcc4"})
  27. elseif c=="e" then
  28. set_item("it-trigger", i-1,line, {action="callback", target="funcc5"})
  29. elseif c=="f" then
  30. set_item("it-trigger", i-1,line, {action="callback", target="funcc6"})
  31. elseif c=="g" then
  32. set_item("it-trigger", i-1,line, {action="callback", target="funcc7"})
  33. elseif c=="h" then
  34. set_item("it-trigger", i-1,line, {action="callback", target="funcc8"})
  35. elseif c=="i" then
  36. set_item("it-trigger", i-1,line, {action="callback", target="funcc9"})
  37. elseif c=="j" then
  38. set_item("it-trigger", i-1,line, {action="callback", target="funcc10"})
  39. elseif c=="k" then
  40. set_item("it-trigger", i-1,line, {action="callback", target="funcc11"})
  41. elseif c=="l" then
  42. set_item("it-trigger", i-1,line, {action="callback", target="funcc12"})
  43. elseif c=="m" then
  44. set_item("it-trigger", i-1,line, {action="callback", target="funcc13"})
  45. elseif c=="n" then
  46. set_item("it-trigger", i-1,line, {action="callback", target="funcc14"})
  47. elseif c=="O" then
  48. set_item("it-trigger", i-1,line, {action="callback", target="funcc15"})
  49. elseif c=="p" then
  50. set_item("it-trigger", i-1,line, {action="callback", target="funcc16"})
  51. elseif c=="q" then
  52. set_item("it-trigger", i-1,line, {action="callback", target="funcc17"})
  53. elseif c=="r" then
  54. set_item("it-trigger", i-1,line, {action="callback", target="funcc18"})
  55. elseif c=="s" then
  56. set_item("it-trigger", i-1,line, {action="callback", target="funcc19"})
  57. elseif c=="t" then
  58. set_item("it-trigger", i-1,line, {action="callback", target="funcc20"})
  59. elseif c=="u" then
  60. set_item("it-trigger", i-1,line, {action="callback", target="funcc21"})
  61. elseif c=="v" then
  62. set_item("it-trigger", i-1,line, {action="callback", target="funcc22"})
  63. elseif c=="W" then
  64. set_item("it-trigger", i-1,line, {action="callback", target="funcc23"})
  65. elseif c=="x" then
  66. set_item("it-trigger", i-1,line, {action="callback", target="funcc24"})
  67. elseif c=="y" then
  68. set_item("it-trigger", i-1,line, {action="callback", target="funcc25"})
  69.         elseif c=="G" then
  70.             doorh( i-1,line, {name="door1"})
  71.         elseif c=="H" then
  72.             doorh( i-1,line, {name="door2"})
  73. elseif c=="C" then
  74.     set_item("it-coin", i-1,line,{value=0})
  75. elseif c=="D" then
  76.     set_item("it-coin", i-1,line,{value=1})
  77. elseif c=="E" then
  78.     set_item("it-coin", i-1,line,{value=2})
  79.         elseif c=="F" then
  80.             set_stone("st-switch", i-1,line, {action="callback",target="funcc26"})
  81.         end
  82.     end    
  83. end
  84.  
  85. -- Floor:  " "
  86. -- Border: "#"
  87. -- Oxyd:   "o"
  88.  
  89. renderLine(00,"#############################################################################")
  90. renderLine(01,"#                  #                  #                  #                  #")
  91. renderLine(02,"#                  #                  #                  #                  #")
  92. renderLine(03,"#      ##  #       #       #  #       #      #           #      ooooo       #")
  93. renderLine(04,"#      #  ##       #       ## #       #      # ##        #      o   o       #")
  94. renderLine(05,"#       #  #       #      ## ##       #       #  #       #      o   o       #")
  95. renderLine(06,"#      # ##        #         #        #       # ##       #      o   o       #")
  96. renderLine(07,"#      ### #       #      # ##        #      # ##        #      ooooo       #")
  97. renderLine(08,"#                  #                  #                  #                  #")
  98. renderLine(09,"#                  #                  #                  #                  #")
  99. renderLine(10,"#        #         #        #         #        #         #       # #        #")
  100. renderLine(11,"#        #         #        #         #        #         #       # #        #")
  101. renderLine(12,"###### ##### ############ ##### ############ ##### ############# # # ########")
  102. renderLine(13,"#        #         #        #         #        #         #       # #        #")
  103. renderLine(14,"#        #         #        #         #        #         #       # #        #")
  104. renderLine(15,"#                  #                  #                  #                  #")
  105. renderLine(16,"#      ## #        #        #         #       # #        #       # ##       #")
  106. renderLine(17,"#       ## #       #      #  ##       #      ##  #       #      ####        #")
  107. renderLine(18,"#      ####        #        ###       #       # #        #      ##  #       #")
  108. renderLine(19,"#      ## ##       #       ## #       #      # ###       #       ####       #")
  109. renderLine(20,"#       ##         #      #  #        #      # #         #       #          #")
  110. renderLine(21,"#                  #                  #                  #                  #")
  111. renderLine(22,"#       # #        #       # #        #       # #        #        #         #")
  112. renderLine(23,"#       # #        #       # #        #       # #        #        #         #")
  113. renderLine(24,"####### # # ############## # # ############## # # #############G#####H##########################")
  114. renderLine(25,"#       # #        #       # #        #       # #        #        #    abcde                   #")
  115. renderLine(26,"#       # #        #       # #        #       # #        #        #    fghij#                  #")
  116. renderLine(27,"#                                                        #             klmnO#     CDECDECD     #")
  117. renderLine(28,"#                  #                  #     wwwwwww            wwwwwww pqrst#     ECDECDEC     #")
  118. renderLine(29,"#         ##       #       ## #       #     w     w    #####   w     w uvWxy#     DECDECDE     #")
  119. renderLine(30,"#      ####      #####    ####      #####   w     w            w     w      #     CDECDECD     #")
  120. renderLine(31,"#      # ###       #      ###         #                #####   w     w      #     ECDECDEC     #")
  121. renderLine(32,"#       ## #       #       ####       #     w     w            w     w      #     DECDECDE     #")
  122. renderLine(33,"#      #   #                #   z           w     w      #     w     w      #     CDECDECD     #")
  123. renderLine(34,"#                  #                  #     wwwwwww      #     wwwwwww      #                  #")
  124. renderLine(35,"#                  #                  #                  #                 F#                  #")
  125. renderLine(36,"################################################################################################")
  126.  
  127. -- ## # 
  128. --  ####
  129. --    ##
  130. -- ###  
  131. --    # 
  132.  
  133. -- # #  
  134. --  ####
  135. --  #   
  136. -- #### 
  137. -- # ###
  138.  
  139. oxyd_shuffle()
  140.  
  141. door1=enigma.GetNamedObject("door1")
  142. door2=enigma.GetNamedObject("door2")
  143.  
  144. f1=0
  145. ff1=0
  146. function funcc1()
  147. if ff1==0 then
  148.     if f1==1 then
  149.        enigma.KillStone(64,29)
  150. f1=0
  151.     elseif f1==0 then
  152.     set_stone( "st-greenbrown", 64, 29)
  153. f1=1
  154.      end
  155. ff1=1
  156.   elseif ff1==1 then
  157. ff1=0
  158. end
  159. end
  160.  
  161. f2=0
  162. ff2=0
  163. function funcc2()
  164. if ff2==0 then
  165.     if f2==1 then
  166.        enigma.KillStone(65,29)
  167. f2=0
  168.     elseif f2==0 then
  169.     set_stone( "st-greenbrown", 65, 29)
  170. f2=1
  171.      end
  172. ff2=1
  173.   elseif ff2==1 then
  174. ff2=0
  175. end
  176. end
  177.  
  178. f3=0
  179. ff3=0
  180. function funcc3()
  181. if ff3==0 then
  182.     if f3==1 then
  183.        enigma.KillStone(66,29)
  184. f3=0
  185.     elseif f3==0 then
  186.     set_stone( "st-greenbrown", 66, 29)
  187. f3=1
  188.      end
  189. ff3=1
  190.  elseif ff3==1 then
  191. ff3=0
  192. end
  193. end
  194.  
  195. f4=0
  196. ff4=0
  197. function funcc4()
  198. if ff4==0 then
  199.    if f4==1 then
  200.        enigma.KillStone(67,29)
  201. f4=0
  202.     elseif f4==0 then
  203.     set_stone( "st-greenbrown", 67, 29)
  204. f4=1
  205.      end
  206. ff4=1
  207.   elseif ff4==1 then
  208. ff4=0
  209. end
  210. end
  211.  
  212. f5=0
  213. ff5=0
  214. function funcc5()
  215. if ff5==0 then
  216.     if f5==1 then
  217.        enigma.KillStone(68,29)
  218. f5=0
  219.    elseif f5==0 then
  220.     set_stone( "st-greenbrown", 68, 29)
  221. f5=1
  222.      end
  223. ff5=1
  224.   elseif ff5==1 then
  225. ff5=0
  226. end
  227. end
  228.  
  229. f6=0
  230. ff6=0
  231. function funcc6()
  232. if ff6==0 then
  233.     if f6==1 then
  234.        enigma.KillStone(64,30)
  235. f6=0
  236.    elseif f6==0 then
  237.     set_stone( "st-greenbrown", 64, 30)
  238. f6=1
  239.      end
  240. ff6=1
  241.   elseif ff6==1 then
  242. ff6=0
  243. end
  244. end
  245.  
  246. f7=0
  247. ff7=0
  248. function funcc7()
  249. if ff7==0 then
  250.     if f7==1 then
  251.        enigma.KillStone(65,30)
  252. f7=0
  253.    elseif f7==0 then
  254.     set_stone( "st-greenbrown", 65, 30)
  255. f7=1
  256.      end
  257. ff7=1
  258.   elseif ff7==1 then
  259. ff7=0
  260. end
  261. end
  262.  
  263. f8=0
  264. ff8=0
  265. function funcc8()
  266. if ff8==0 then
  267.     if f8==1 then
  268.        enigma.KillStone(66,30)
  269. f8=0
  270.    elseif f8==0 then
  271.     set_stone( "st-greenbrown", 66, 30)
  272. f8=1
  273.      end
  274. ff8=1
  275.   elseif ff8==1 then
  276. ff8=0
  277. end
  278. end
  279.  
  280. f9=0
  281. ff9=0
  282. function funcc9()
  283. if ff9==0 then
  284.     if f9==1 then
  285.        enigma.KillStone(67,30)
  286. f9=0
  287.    elseif f9==0 then
  288.     set_stone( "st-greenbrown", 67, 30)
  289. f9=1
  290.      end
  291. ff9=1
  292.   elseif ff9==1 then
  293. ff9=0
  294. end
  295. end
  296.  
  297. f10=0
  298. ff10=0
  299. function funcc10()
  300. if ff10==0 then
  301.     if f10==1 then
  302.        enigma.KillStone(68,30)
  303. f10=0
  304.    elseif f10==0 then
  305.     set_stone( "st-greenbrown", 68, 30)
  306. f10=1
  307.      end
  308. ff10=1
  309.   elseif ff10==1 then
  310. ff10=0
  311. end
  312. end
  313.  
  314. f11=0
  315. ff11=0
  316. function funcc11()
  317. if ff11==0 then
  318.     if f11==1 then
  319.        enigma.KillStone(64,31)
  320. f11=0
  321.    elseif f11==0 then
  322.     set_stone( "st-greenbrown", 64, 31)
  323. f11=1
  324.      end
  325. ff11=1
  326.   elseif ff11==1 then
  327. ff11=0
  328. end
  329. end
  330.  
  331. f12=0
  332. ff12=0
  333. function funcc12()
  334. if ff12==0 then
  335.     if f12==1 then
  336.        enigma.KillStone(65,31)
  337. f12=0
  338.    elseif f12==0 then
  339.     set_stone( "st-greenbrown", 65, 31)
  340. f12=1
  341.      end
  342. ff12=1
  343.   elseif ff12==1 then
  344. ff12=0
  345. end
  346. end
  347.  
  348. f13=0
  349. ff13=0
  350. function funcc13()
  351. if ff13==0 then
  352.     if f13==1 then
  353.        enigma.KillStone(66,31)
  354. f13=0
  355.    elseif f13==0 then
  356.     set_stone( "st-greenbrown", 66, 31)
  357. f13=1
  358.      end
  359. ff13=1
  360.   elseif ff13==1 then
  361. ff13=0
  362. end
  363. end
  364.  
  365. f14=0
  366. ff14=0
  367. function funcc14()
  368. if ff14==0 then
  369.     if f14==1 then
  370.        enigma.KillStone(67,31)
  371. f14=0
  372.    elseif f14==0 then
  373.     set_stone( "st-greenbrown", 67, 31)
  374. f14=1
  375.      end
  376. ff14=1
  377.   elseif ff14==1 then
  378. ff14=0
  379. end
  380. end
  381.  
  382. f15=0
  383. ff15=0
  384. function funcc15()
  385. if ff15==0 then
  386.     if f15==1 then
  387.        enigma.KillStone(68,31)
  388. f15=0
  389.    elseif f15==0 then
  390.     set_stone( "st-greenbrown", 68, 31)
  391. f15=1
  392.      end
  393. ff15=1
  394.   elseif ff15==1 then
  395. ff15=0
  396. end
  397. end
  398.  
  399. f16=0
  400. ff16=0
  401. function funcc16()
  402. if ff16==0 then
  403.     if f16==1 then
  404.        enigma.KillStone(64,32)
  405. f16=0
  406.    elseif f16==0 then
  407.     set_stone( "st-greenbrown", 64, 32)
  408. f16=1
  409.      end
  410. ff16=1
  411.   elseif ff16==1 then
  412. ff16=0
  413. end
  414. end
  415.  
  416. f17=0
  417. ff17=0
  418. function funcc17()
  419. if ff17==0 then
  420.     if f17==1 then
  421.        enigma.KillStone(65,32)
  422. f17=0
  423.    elseif f17==0 then
  424.     set_stone( "st-greenbrown", 65, 32)
  425. f17=1
  426.      end
  427. ff17=1
  428.   elseif ff17==1 then
  429. ff17=0
  430. end
  431. end
  432.  
  433. f18=0
  434. ff18=0
  435. function funcc18()
  436. if ff18==0 then
  437.     if f18==1 then
  438.        enigma.KillStone(66,32)
  439. f18=0
  440.    elseif f18==0 then
  441.     set_stone( "st-greenbrown", 66, 32)
  442. f18=1
  443.      end
  444. ff18=1
  445.   elseif ff18==1 then
  446. ff18=0
  447. end
  448. end
  449.  
  450. f19=0
  451. ff19=0
  452. function funcc19()
  453. if ff19==0 then
  454.     if f19==1 then
  455.        enigma.KillStone(67,32)
  456. f19=0
  457.    elseif f19==0 then
  458.     set_stone( "st-greenbrown", 67, 32)
  459. f19=1
  460.      end
  461. ff19=1
  462.   elseif ff19==1 then
  463. ff19=0
  464. end
  465. end
  466.  
  467. f20=0
  468. ff20=0
  469. function funcc20()
  470. if ff20==0 then
  471.     if f20==1 then
  472.        enigma.KillStone(68,32)
  473. f20=0
  474.    elseif f20==0 then
  475.     set_stone( "st-greenbrown", 68, 32)
  476. f20=1
  477.      end
  478. ff20=1
  479.   elseif ff20==1 then
  480. ff20=0
  481. end
  482. end
  483.  
  484. f21=0
  485. ff21=0
  486. function funcc21()
  487. if ff21==0 then
  488.     if f21==1 then
  489.        enigma.KillStone(64,33)
  490. f21=0
  491.    elseif f21==0 then
  492.     set_stone( "st-greenbrown", 64, 33)
  493. f21=1
  494.      end
  495. ff21=1
  496.   elseif ff21==1 then
  497. ff21=0
  498. end
  499. end
  500.  
  501. f22=0
  502. ff22=0
  503. function funcc22()
  504. if ff22==0 then
  505.     if f22==1 then
  506.        enigma.KillStone(65,33)
  507. f22=0
  508.    elseif f22==0 then
  509.     set_stone( "st-greenbrown", 65, 33)
  510. f22=1
  511.      end
  512. ff22=1
  513.   elseif ff22==1 then
  514. ff22=0
  515. end
  516. end
  517.  
  518. f23=0
  519. ff23=0
  520. function funcc23()
  521. if ff23==0 then
  522.     if f23==1 then
  523.        enigma.KillStone(66,33)
  524. f23=0
  525.    elseif f23==0 then
  526.     set_stone( "st-greenbrown", 66, 33)
  527. f23=1
  528.      end
  529. ff23=1
  530.   elseif ff23==1 then
  531. ff23=0
  532. end
  533. end
  534.  
  535. f24=0
  536. ff24=0
  537. function funcc24()
  538. if ff24==0 then
  539.     if f24==1 then
  540.        enigma.KillStone(67,33)
  541. f24=0
  542.    elseif f24==0 then
  543.     set_stone( "st-greenbrown", 67, 33)
  544. f24=1
  545.      end
  546. ff24=1
  547.   elseif ff24==1 then
  548. ff24=0
  549. end
  550. end
  551.  
  552. f25=0
  553. ff25=0
  554. function funcc25()
  555. if ff25==0 then
  556.     if f25==1 then
  557.        enigma.KillStone(68,33)
  558. f25=0
  559.    elseif f25==0 then
  560.     set_stone( "st-greenbrown", 68, 33)
  561. f25=1
  562.      end
  563. ff25=1
  564.   elseif ff25==1 then
  565. ff25=0
  566. end
  567. end
  568.  
  569. -- # #  
  570. --  ####
  571. --  #   
  572. -- #### 
  573. --   ###
  574. -- 1,0,1,0,0
  575. -- 0,1,1,1,1
  576. -- 0,1,0,0,0
  577. -- 1,1,1,1,0
  578. -- 0,0,1,1,1
  579. function funcc26()
  580. if   f1==1 and f2==0 and f3==1 and f4==0 and f5==0 
  581. and  f6==0 and f7==1 and f8==1 and f9==1 and f10==1 
  582. and f11==0 and f12==1 and f13==0 and f14==0 and f15==0 
  583. and f16==1 and f17==1 and f18==1 and f19==1 and f20==0 
  584. and f21==1 and f22==0 and f23==1 and f24==1 and f25==1 then
  585.     enigma.SendMessage(door1, "openclose", nil)
  586.     enigma.SendMessage(door2, "openclose", nil)
  587. end
  588. end