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

  1. levelw=80
  2. levelh=15
  3. enigma.ConserveLevel = FALSE        -- dh
  4.  
  5. create_world( levelw, levelh)
  6.  
  7. fill_floor("fl-metal", 0,0,levelw,levelh)
  8.  
  9. function renderLine( line, pattern)
  10.     for i=1, strlen(pattern) do
  11.         local c = strsub( pattern, i, i)
  12.         if c =="#" then
  13.             set_stone( "st-greenbrown", i-1, line)
  14.         elseif c =="D" then
  15.             set_stone( "st-death", i-1, line)
  16.         elseif c == "o" then
  17.             oxyd( i-1, line)
  18.                 elseif c == "!" then
  19.             abyss(i-1,line)
  20. --            fill_floor("fl-water", i-1,line, 1,1)
  21.         elseif c=="+" then
  22.             set_stone( "st-wood", i-1, line)
  23.         elseif c=="g" then
  24.             draw_stones("st-grate1",{i-1,line}, {1,1}, 1)
  25.  
  26.         elseif c=="h" then
  27.            set_item("it-tinyhollow", i-1, line)
  28.         elseif c=="H" then
  29.            set_item("it-hollow", i-1, line)
  30.         elseif c=="J" then
  31.            set_item("it-hill", i-1, line)
  32.         elseif c=="j" then
  33.            set_item("it-tinyhill", i-1, line)
  34.         elseif c == "1" then --ur
  35.            set_floor("fl-gradient",  i-1,  line, {type=11})
  36.         elseif c == "3" then --dl
  37.            set_floor("fl-gradient",  i-1,  line, {type=9})
  38.         elseif c == "7" then --dr
  39.            set_floor("fl-gradient",  i-1,  line, {type=12})
  40.         elseif c == "9" then --ul
  41.            set_floor("fl-gradient",  i-1,  line, {type=10})
  42.         elseif c == "4" then --dl
  43.            set_floor("fl-gradient",  i-1,  line, {type=4})
  44.          elseif c == "S" then
  45.            set_stone("st-bolder", i-1,line, {name="bolder1",direction=SOUTH})
  46.         elseif c == "R" then
  47.            set_stone("st-bolder", i-1,line, {name="bolder2",direction=EAST})
  48.         elseif c=="u" then
  49.            set_item("it-trigger", i-1,line, {action="callback", target="funcc1"})
  50.         elseif c=="r" then
  51.            set_item("it-trigger", i-1,line, {action="callback", target="funcc2"})
  52.         elseif c=="d" then
  53.            set_item("it-trigger", i-1,line, {action="callback", target="funcc3"})
  54.         elseif c=="l" then
  55.            set_item("it-trigger", i-1,line, {action="callback", target="funcc4"})
  56.         elseif c=="s" then
  57.            set_item("it-trigger", i-1,line, {action="callback", target="funcc5"})
  58.         elseif c=="e" then
  59.            set_item("it-trigger", i-1,line, {action="callback", target="funcc6"})
  60.         elseif c=="A" then
  61.            set_stone("st-switch", i-1,line, {action="openclose",target="door1"})
  62.         elseif c=="B" then
  63.            set_stone("st-switch", i-1,line, {action="callback",target="funcc7"})
  64.         elseif c=="C" then
  65.            set_stone("st-switch", i-1,line, {action="openclose",target="door2"})
  66.         elseif c=="F" then
  67.            set_stone("st-switch", i-1,line, {action="openclose",target="door3"})
  68.         elseif c=="a" then
  69.            doorh( i-1,line, {name="door1"})
  70.         elseif c=="c" then
  71.            doorh( i-1,line, {name="door2"})
  72.         elseif c=="f" then
  73.            doorh( i-1,line, {name="door3"})
  74.         elseif c=="y" then
  75.            set_actor("ac-whiteball",  i-.5, line+1, {player=1})
  76.         elseif c=="L" then
  77.             oneway(i-1,line, enigma.WEST)
  78.         elseif c=="~" then
  79.             oneway(i-1,line, enigma.NORTH)
  80.         elseif c=="`" then
  81.             oneway(i-1,line, enigma.SOUTH)
  82.         elseif c =="X" then
  83.            set_stone( "st-rubberband", i-1, line,{strength=0})
  84.  
  85. elseif c=="w" then
  86. yy1( "white",  i-1, line)
  87.         end
  88.     end    
  89. end
  90.  
  91. function yy1( color, x, y)
  92.         stone = format( "st-%s4", color)
  93.         set_stone( stone, x, y)
  94. end
  95.  
  96. -- Floor:  " "
  97. -- Border: "#"
  98. -- Oxyd:   "o"
  99.  
  100. renderLine(00,"####################################################################")
  101. renderLine(01,"#                  #DDDDDDDDDDDDDDDDDD#C#         #d#              #")
  102. renderLine(02,"#                  #D                D# #         #!#              #")
  103. renderLine(03,"#                  #D                D# #                          #")
  104. renderLine(04,"#  #################D   #DDDDDDDD#   D#~#   #c#####!## #############")
  105. renderLine(05,"#        D         #D   D            D#     #`#s     !R!l#")
  106. renderLine(06,"#   J    31     D  #D   DA           D######o #e    l# # #")
  107. renderLine(07,"#  j     97        #D   DDDDD#a#DDDDDD#       #####!## ######")
  108. renderLine(08,"#     D        J   #D        # #     D#ooooooo#             #")
  109. renderLine(09,"# D    31     D    #D        D #     D#########    S        #")
  110. renderLine(10,"#  J   97    J     #######   D    #   jJJJJJJJj  ##!#########")
  111. renderLine(11,"#          D       J         D    #   jJJJJJJJj  # u     #")
  112. renderLine(12,"##########################################################")
  113.  
  114.  
  115. oxyd_shuffle()
  116.  
  117. local actor0=set_actor("ac-blackball", 15.5,2.5,{player=0})
  118. local actor1=set_actor("ac-whiteball-small", 14.5,2.5, {player=1})
  119. local actor2=set_actor("ac-whiteball-small", 13.5,2.5, {player=1})
  120. local actor3=set_actor("ac-whiteball-small", 12.5,2.5, {player=1})
  121. local actor4=set_actor("ac-whiteball-small", 11.5,2.5, {player=1})
  122. local actor5=set_actor("ac-whiteball-small", 10.5,2.5, {player=1})
  123. local actor6=set_actor("ac-whiteball-small", 9.5,2.5, {player=1})
  124. local actor7=set_actor("ac-whiteball-small", 8.5,2.5, {player=1})
  125. local actor8=set_actor("ac-whiteball-small", 7.5,2.5, {player=1})
  126. local actor9=set_actor("ac-whiteball-small", 6.5,2.5, {player=1})
  127. local actor10=set_actor("ac-whiteball-small", 5.5,2.5, {player=1})
  128. local actor11=set_actor("ac-whiteball-small", 4.5,2.5, {player=1})
  129.  
  130. rr=0
  131.  
  132.  
  133. bolder1=enigma.GetNamedObject("bolder1")
  134. bolder2=enigma.GetNamedObject("bolder2")
  135.  
  136. AddRubberBand(actor0, actor1, 50,0)
  137. AddRubberBand(actor1, actor2, 50,0)
  138. AddRubberBand(actor2, actor3, 50,0)
  139. AddRubberBand(actor3, actor4, 50,0)
  140. AddRubberBand(actor4, actor5, 50,0)
  141. AddRubberBand(actor5, actor6, 50,0)
  142. AddRubberBand(actor6, actor7, 50,0)
  143. AddRubberBand(actor7, actor8, 50,0)
  144. AddRubberBand(actor8, actor9, 50,0)
  145. AddRubberBand(actor9, actor10, 50,0)
  146. AddRubberBand(actor10, actor11, 50,0)
  147.  
  148. s1=0
  149. e1=0
  150. ss=0
  151. ee=0
  152. rr=0
  153.  
  154. function funcc1()
  155.    set_attribs(enigma.GetNamedObject("bolder1"), {direction=NORTH})
  156. end
  157.  
  158. function funcc2()
  159.    set_attribs(enigma.GetNamedObject("bolder2"), {direction=EAST})
  160. end
  161.  
  162. function funcc3()
  163.    set_attribs(enigma.GetNamedObject("bolder1"), {direction=SOUTH})
  164. end
  165.  
  166. function funcc4()
  167.    set_attribs(enigma.GetNamedObject("bolder2"), {direction=WEST})
  168. end
  169.  
  170. function funcc5()
  171. if ss==0 then
  172. if s1==0 then
  173.    set_attribs(enigma.GetNamedObject("bolder2"), {direction=SOUTH})
  174. s1=1
  175. elseif s1==1 then
  176.    set_attribs(enigma.GetNamedObject("bolder2"), {direction=EAST})
  177. s1=0
  178. end
  179. ss=1
  180. elseif ss==1 then
  181. ss=0
  182. end
  183. end
  184.  
  185. function funcc6()
  186.    if ee==0 then
  187.       if e1==0 then
  188.      set_attribs(enigma.GetNamedObject("bolder2"), {direction=EAST})
  189.      e1=1
  190.       elseif e1==1 then
  191.      set_attribs(enigma.GetNamedObject("bolder2"), {direction=NORTH})
  192.      e1=0
  193.       end
  194.       ee=1
  195.    elseif ee==1 then
  196.       ee=0
  197.    end
  198. end