home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 August / GSSH0804.iso / Geschicklichkeit / Enigma / Enigma-081.exe / data / levels / duffy17.lua < prev    next >
Text File  |  2003-02-01  |  6KB  |  154 lines

  1. levelw=50
  2. levelh=50
  3.  
  4. create_world( levelw, levelh)
  5.  
  6. fill_floor("fl-metal", 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 == "o" then
  14.             oxyd( i-1, line)
  15.                 elseif c == "!" then
  16. --            abyss(i-1,line)
  17.             fill_floor("fl-water", i-1,line, 1,1)
  18.         elseif c == "s" then
  19.             set_stone("st-stoneimpulse", i-1,line)
  20.         elseif c == "2" then --1-d
  21.             set_floor("fl-gradient",  i-1,  line, {type=1})
  22.         elseif c == "8" then --2-u
  23.             set_floor("fl-gradient",  i-1,  line, {type=2})
  24.         elseif c == "6" then --3-r
  25.             set_floor("fl-gradient",  i-1,  line, {type=3})
  26.         elseif c == "4" then --4-l
  27.             set_floor("fl-gradient",  i-1,  line, {type=4})
  28.         elseif c == "1" then --ur
  29.             set_floor("fl-gradient",  i-1,  line, {type=11})
  30.         elseif c == "3" then --dl
  31.             set_floor("fl-gradient",  i-1,  line, {type=9})
  32.         elseif c == "7" then --dr
  33.             set_floor("fl-gradient",  i-1,  line, {type=12})
  34.         elseif c == "9" then --ul
  35.             set_floor("fl-gradient",  i-1,  line, {type=10})
  36.         elseif c=="z" then
  37.             set_actor("ac-blackball", i-.5,line+.5, {player=0})
  38.             set_item("it-yinyang", i-1, line+.5)
  39.         elseif c=="y" then
  40.             set_actor("ac-whiteball", i-.5,line+.5, {player=1})
  41.             set_item("it-yinyang", i-1, line+.5)
  42.         elseif c=="+" then
  43.             set_stone( "st-wood", i-1, line)
  44.             fill_floor("fl-leaves", i-1,line, 1,1)
  45.         elseif c==":" then
  46.             fill_floor("fl-space", i-1,line, 1,1)
  47.         elseif c=="=" then
  48.             fill_floor("fl-leaves", i-1,line, 1,1)
  49.         elseif c=="S" then
  50.             set_stone( "st-swap", i-1, line)
  51.         elseif c == "R" then
  52.             puzzle(i-1,line,PUZ_0100)
  53.         elseif c == "L" then
  54.             puzzle(i-1,line,PUZ_0001)
  55.         elseif c=="g" then
  56.             draw_stones("st-grate1",{i-1,line}, {1,1}, 1)
  57.         elseif c=="h" then
  58.             doorh(i-1,line,{name="door1"})
  59.         elseif c=="q" then
  60.             doorh(i-1,line,{name="door2"})
  61.         elseif c=="j" then
  62.             doorh(i-1,line,{name="door3"})
  63.         elseif c=="v" then
  64.             doorh(i-1,line,{name="door4"})
  65.         elseif c=="u" then
  66.             oneway(i-1,line, enigma.NORTH)
  67.             fill_floor("fl-inverse", i-1,line, 1,1)
  68.         elseif c=="r" then
  69.             oneway(i-1,line, enigma.EAST)
  70.             fill_floor("fl-inverse", i-1,line, 1,1)
  71.         elseif c=="d" then
  72.             oneway(i-1,line, enigma.SOUTH)
  73.             fill_floor("fl-inverse", i-1,line, 1,1)
  74.         elseif c=="l" then
  75.             oneway(i-1,line, enigma.WEST)
  76.             fill_floor("fl-inverse", i-1,line, 1,1)
  77.         elseif c=="I" then
  78.             fill_floor("fl-inverse", i-1,line, 1,1)
  79.         elseif c=="F" then
  80.             set_stone("st-floppy", i-1, line, {action="openclose", target="door2"})
  81.         elseif c=="U" then
  82.             set_stone("st-floppy", i-1, line, {action="openclose", target="door3"})
  83.  
  84.         elseif c=="f" then
  85.             set_item("it-floppy", i-1, line)
  86.         elseif c=="K" then
  87.             set_stone("st-key_a", i-1, line, {action="openclose", target="door1"})
  88.         elseif c=="V" then
  89.             set_stone("st-key_a", i-1, line, {action="openclose", target="door4"})
  90.         elseif c=="k" then        
  91.             set_item("it-key_a", i-1 ,line)
  92.         elseif c == "b" then
  93.             yy1( "black",  i-1, line)
  94.         elseif c == "w" then
  95.             yy1( "white",  i-1, line)
  96.         elseif c == "X" then
  97.                     draw_stones("st-yinyang1", { i-1,line}, {0,1},1)
  98.         elseif c=="P" then
  99.             set_item("it-brush",i-1,line)
  100.         elseif c=="p" then
  101.             draw_stones("st-stonebrush", {i-1,line}, {1,0},1)
  102.         end
  103.     end    
  104. end
  105.  
  106. function yy1( color, x, y)
  107.         stone = format( "st-%s4", color)
  108.         set_stone( stone, x, y)
  109. end
  110.  
  111. -- Floor:  " "
  112. -- Border: "#"
  113. -- Oxyd:   "o"
  114.  
  115. renderLine(00,"#######################################")
  116. renderLine(01,"#===s=======!!!!===p p   ppppp    p   #")
  117. renderLine(02,"#===s+=+=!!!!!!!+==p ppp p     pp p p #")
  118. renderLine(03,"#===s=+=!!!+!!!!===p p   ppppppp    p #")
  119. renderLine(04,"#===s+=!!!!=!!!!===p p ppp p  Pppppp  #")
  120. renderLine(05,"#==+#!!!!!!=!!!!===p p p   p ppp p  p #")
  121. renderLine(06,"#===!!!!++!!!!!!===p p p ppp p     p  #")
  122. renderLine(07,"#==+!!====!!!!!!+==p           p pp p #")
  123. renderLine(08,"#===!!==+=!!!==!===ppp p pppppp     p #")
  124. renderLine(09,"#===!!==!!!!+==!===  p p       p pp   #")
  125. renderLine(10,"#===!!#!!+!!!!!!===p p  pppppp p p p  #")
  126. renderLine(11,"#==+!!!!!====!!!===p   p       p p    #")
  127. renderLine(12,"###### #############################v##")
  128. renderLine(13,"#                  #o##bbbbbbbbbbbwX K#")
  129. renderLine(14,"#w#w#w#w#w#w#w#w#wb#h##bwwwwwwwwwbw# U#") 
  130. renderLine(15,"#wbXbXbXbXbXbXbXbXb# k#bwbbbbbbbwbw#  #")
  131. renderLine(16,"#wbwbwbwbwbwbwbwbwb#  #bwbwwww#bwbw#y #")
  132. renderLine(17,"#wbwbwbwbwbwbwbwbwb#  #bwbw#  #bwbw#  #") 
  133. renderLine(18,"#wbwbwbwbwbwbwbwbwb#bb#bwbw#RL#bwbw#ww#")
  134. renderLine(19,"#wbwbwbwbwbwbwbwbwb#  #bwbw#  #bwbw#  #")
  135. renderLine(20,"#wbwbwbwbwbwbwbwbwb# z#bwbw#bbbbwbw#  #") 
  136. renderLine(21,"#wXwXwXwXwXwXwXwXwX#  #bwbwwwwwwwbw#f #")
  137. renderLine(22,"##b#b#b#b#b#b#b#bwb#V #bwbbbbbbbbbw##q#")
  138. renderLine(23,"#                  #F Xbwwwwwwwwwww##o#") 
  139. renderLine(24,"######### ###########j#################")
  140. renderLine(25,"#:::::::::::#::::::#IIlIIIII#II#IIIrII#")
  141. renderLine(26,"#:::#::::::::::#:::#d###u##I#IIlIII#II#")
  142. renderLine(27,"#::::::::::::::#:::#III#II###d##II##d##")
  143. renderLine(28,"#222222#:::#:::::::#IIIlIIlIIII#u##III#")
  144. renderLine(29,"#::::::####::::::::##d######IIIrII###d#")
  145. renderLine(30,"#:::::::::4::::::::#IIIIIIIrI###IIlIII#")
  146. renderLine(31,"##::::::::122222222#######d###IlII#III#")
  147. renderLine(32,"#::::::##::::::::::#IIIIIrIlI#u#####ud#")
  148. renderLine(33,"#::::::::::::::##::#d###u#u#IIIrIIIlII#")
  149. renderLine(34,"#IIIIIIIIIIIIIIIIII#IIIrIIIrII####I##I#")
  150. renderLine(35,"#IIIIIIIIIIIIIIIIIIIIII#IIIlIIlIIlIIrI#")
  151. renderLine(36,"#######################################")
  152.  
  153. oxyd_shuffle()
  154.