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

  1. levelw=80
  2. levelh=20
  3.  
  4. create_world( levelw, levelh)
  5.  
  6. fill_floor("fl-leaves", 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-glass", 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=="z" then
  19.             set_actor("ac-blackball", i-.5,line+.5, {player=0})
  20.         elseif c=="+" then
  21.             set_stone( "st-wood", i-1, line)
  22.         elseif c=="W" then
  23.             set_attrib(laser(i-1,line, FALSE, WEST), "name", "laser")
  24.         elseif c=="L" then
  25.             set_stone("st-key_a", i-1,line, {action="on", target="laser"})
  26.         elseif c=="k" then
  27.             set_item("it-key_a", i-1,line)
  28.         elseif c=="`" then
  29.             mirrorp(i-1,line,FALSE,TRUE, 2)
  30.         elseif c=="/" then
  31.             mirrorp(i-1,line,FALSE,TRUE, 4)
  32.         elseif c=="B" then
  33.             set_stone("st-bombs", i-1,line)
  34.         elseif c=="d" then
  35.             set_stone("st-oneway", i-1,line, {orientation=enigma.SOUTH})    
  36.         elseif c=="l" then
  37.             set_stone("st-oneway", i-1,line, {orientation=enigma.WEST})
  38.         elseif c=="F" then    
  39.             set_item("it-floppy", i-1,line)
  40.         elseif c=="c" then    
  41.             set_item("it-coin", i-1,line,{value=2})
  42.         elseif c=="5" then    
  43.             set_item("it-coin", i-1,line,{value=1})
  44.         elseif c=="4" then    
  45.             set_item("it-coin", i-1,line,{value=3})
  46.         elseif c=="P" then
  47.             set_item("it-brush",i-1,line)
  48.         elseif c=="h" then
  49.             hammer(i-1,line)
  50.         elseif c=="H" then
  51.             set_stone("st-stone_break", i-1,line)
  52.         elseif c=="f" then
  53.             set_stone( "st-floppy", i-1,line,{action="openclose",target="unimportantdoor"})
  54.         elseif c=="A" then
  55.             doorv( i-1,line, {name="door1"})
  56.         elseif c=="b" then
  57.             doorv( i-1,line, {name="door2"})
  58.         elseif c=="C" then
  59. --            doorh( i-1,line, {name="door3"})
  60.             set_floor("fl-bridge", i-1,line, {name="bridge1", type="yy"})
  61.         elseif c=="D" then
  62.             set_floor("fl-bridge", i-1,line, {name="bridge2", type="yy"})
  63.         elseif c=="1" then
  64.             set_stone("st-switch", i-1,line, {action="callback",target="funcc"})
  65.         elseif c=="2" then
  66.             doorh( i-1,line, {name="unimportantdoor"})
  67.         elseif c=="9" then
  68.             set_stone("st-coinslot", i-1,line, {action="openclose", target="unimportantdoor"})
  69.         end
  70.     end    
  71. end
  72.  
  73. -- Floor:  " "
  74. -- Border: "#"
  75. -- Oxyd:   "o"
  76.  
  77. renderLine(00,"####################B###9###fL###9###1####################")
  78. renderLine(01,"#/                 #                  #                 `#")
  79. renderLine(02,"#/                 #P   z        k   F#                 `#")
  80. renderLine(03,"#/                 #                  #                 `#")
  81. renderLine(04,"#                  ####d####CD####d####                  #")
  82. renderLine(05,"#                  #       #  #       #       #2#        #")
  83. renderLine(06,"#                  #+++++++#ch#+++++++#                  #")
  84. renderLine(07,"#                  #       #  #       #                  #")
  85. renderLine(08,"#                  #+++++++#  #+++++++#                  #")
  86. renderLine(09,"#                  #   H   #  #   H   #                  #")
  87. renderLine(10,"#                  ###++####  ####++###                  #")
  88. renderLine(11,"#  #               # A 4          5 b #               #//#")
  89. renderLine(12,"####################o################o####################")
  90. renderLine(13,"#`                                                     `W#")
  91.  
  92. oxyd_shuffle()
  93.  
  94. door1=enigma.GetNamedObject("door1")
  95. door2=enigma.GetNamedObject("door2")
  96. --door3=enigma.GetNamedObject("door3")
  97. bridge1=enigma.GetNamedObject("bridge1")
  98. bridge2=enigma.GetNamedObject("bridge2")
  99.  
  100. enigma.SendMessage(door1, "openclose", nil)
  101. enigma.SendMessage(door2, "openclose", nil)
  102.  
  103. through=0
  104. function funcc()
  105.     if through==1 then
  106.     through=0
  107.     end
  108.     if through==0 then
  109.     enigma.SendMessage(door1, "openclose", nil)
  110.     enigma.SendMessage(door2, "openclose", nil)
  111. --    enigma.SendMessage(door3, "openclose", nil)
  112.     enigma.SendMessage(bridge1, "openclose", nil)
  113.     enigma.SendMessage(bridge2, "openclose", nil)
  114.     end
  115.     through=through+1
  116. end