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

  1. -- Smutty Smurf 2003
  2. levelw = 20
  3. levelh = 13
  4. create_world(levelw, levelh)
  5. oxyd_default_flavor = "d"       -- Default flavor for oxyd stones.
  6.  
  7. difficult = (options.Difficulty==2)
  8.  
  9. fill_floor("fl-sahara", 0,0, level_width,level_height)
  10. function renderLine( line, pattern)
  11.     for i=1, strlen(pattern) do
  12.       local c = strsub( pattern, i, i)
  13.       if c ==     "G" then
  14.          set_stone("st-glass",i-1,line)
  15.       elseif c=="a" then
  16.      doorh( i-1,line, {name="door1"})
  17.       elseif c=="b" then
  18.      doorv( i-1,line, {name="door2"})
  19.       elseif c=="c" then
  20.      doorv( i-1,line, {name="door3"})
  21.       elseif c=="d" then
  22.      doorh( i-1,line, {name="door4"})
  23.       elseif c=="1" then
  24.      set_stone("st-fourswitch", i-1,line, {action="callback", target="s1"})
  25.       elseif c=="2" then
  26.      set_stone("st-fourswitch", i-1,line, {action="callback", target="s2"})
  27.       elseif c=="3" then
  28.      set_stone("st-fourswitch", i-1,line, {action="callback", target="s3"})
  29.       elseif c=="4" then
  30.      set_stone("st-fourswitch", i-1,line, {action="callback", target="s4"})
  31.       elseif c=="w" then
  32.      set_stone("st-bolder", i-1,line, {name="bolder1", direction=NORTH})
  33.       elseif c=="x" then
  34.      set_stone("st-bolder", i-1,line, {name="bolder2", direction=NORTH})
  35.       elseif c=="y" then
  36.      set_stone("st-bolder", i-1,line, {name="bolder3", direction=NORTH})
  37.       elseif c=="z" then
  38.      set_stone("st-bolder", i-1,line, {name="bolder4", direction=NORTH})
  39.       elseif c == "O" then
  40.          oxyd(i-1,line)
  41.       elseif c == "A" then
  42.          if difficult then
  43.             set_floor("fl-abyss",i-1,line)
  44.          end
  45.       elseif c == "B" then
  46.          set_actor("ac-blackball", i-.5,line+.5, {player=0})
  47.          set_item("it-yinyang",i,line+1)
  48.       elseif c == "W" then
  49.          set_actor("ac-whiteball", i-.5,line+.5, {player=1})
  50.          set_item("it-yinyang",i-1,line)
  51.         end
  52.     end
  53. end
  54. --              01234567890123456789
  55. renderLine(00, "G12GGGGGGGGGGGGGGGGG")
  56. renderLine(01, "GB Gw             xG")
  57. renderLine(02, "G  G               G")
  58. renderLine(03, "G34G               G")
  59. renderLine(04, "GGGG       A       G")
  60. renderLine(05, "Gy        A        G")
  61. renderLine(06, "G        A         G")
  62. renderLine(07, "G       A        G G")
  63. renderLine(08, "G      A       GGOGG")
  64. renderLine(09, "G              GGaGG")
  65. renderLine(10, "G             GObWcO")
  66. renderLine(11, "G             zGGdGG")
  67. renderLine(12, "GGGGGGGGGGGGGGGGGOGG")
  68. --              01234567890123456789
  69.  
  70. set_item ("it-trigger", 7, 4, {action="openclose", target="door1"})
  71. set_item ("it-trigger", 13, 4, {action="openclose", target="door2"})
  72. set_item ("it-trigger", 5, 8, {action="openclose", target="door3"})
  73. set_item ("it-trigger", 11, 8, {action="openclose", target="door4"})
  74.  
  75. hitcounter = { 0, 0, 0, 0 }
  76. todir = { EAST, SOUTH, WEST, NORTH }
  77.  
  78. function sx(x)
  79.    local val = todir[hitcounter[x]+1]
  80.    enigma.SendMessage(enigma.GetNamedObject("bolder"..x), "direction", val)
  81.    hitcounter[x] = hitcounter[x]+1
  82.    if (hitcounter[x]==4) then
  83.       hitcounter[x] = 0
  84.    end
  85. end
  86.  
  87. function s1() sx(1) end
  88. function s2() sx(2) end
  89. function s3() sx(3) end
  90. function s4() sx(4) end
  91.  
  92. oxyd_shuffle()
  93.