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

  1. -- Smutty Smurf
  2. enigma.ConserveLevel = TRUE
  3. levelw = 39
  4. levelh = 25
  5.  
  6. create_world(levelw, levelh)
  7. oxyd_default_flavor = "c"  
  8. difficult = (options.Difficulty==2)
  9. set_actor("ac-blackball", 2.5,2.5, {player=0})
  10. draw_border("st-rock1")
  11. fill_floor("fl-rough", 0,0, levelw,levelh)
  12.  
  13. -- Randsteine verschiebbar
  14. --------------------------------------------------------------------------------------------
  15.    for x=1,7 do
  16.        y=5*x
  17.     set_stone("st-rock1_move",1,y)
  18.     set_stone("st-rock1_move",37,y)
  19.     set_stone("st-rock1_move",y,1)
  20.     set_stone("st-rock1_move",y,23)    
  21.    end
  22.    
  23. set_item("it-floppy",5,1)
  24. set_item("it-blackbomb",10,1)
  25. set_item("it-magnet",15,1)
  26. if difficult then
  27.             set_item("it-flagblack",20,1)
  28.       else
  29.             set_item("it-umbrella",20,1)
  30. end
  31. set_item("it-sword",25,1)
  32. set_item("it-key_a",30,1)
  33. set_item("it-brush",35,1)
  34. set_item("it-yinyang",5,23)
  35. set_item("it-hammer",10,23)
  36. shogundot3(15,23)
  37. set_item("it-whitebomb",20,23)
  38. set_item("it-tinyhollow",25,23)
  39. set_item("it-spade",30,23)
  40. set_item("it-key_c",35,23)
  41. set_item("it-tinyhill",37,5)
  42. document(37,10,"If I only had a bag")
  43. set_item("it-hollow",37,15)
  44. set_item("it-crack",37,20, {type=3})
  45. set_item("it-hill",1,5)
  46. set_item("it-springboard",1,10)
  47. set_item("it-key_b",1,15)
  48. set_item("it-extralife",1,20)
  49.  
  50. -- Einzelrahmen
  51. --------------------------------------------------------------------------------------------
  52. -- Definition eines Rahmens
  53. function draw_border_SS(name,xx0,yy0,w,h)
  54. draw_stones (name,{xx0,yy0}, {1,0},w)   
  55. draw_stones (name,{xx0,(yy0+h-1)}, {1,0},w)
  56. draw_stones (name,{xx0,yy0}, {0,1},h)   
  57. draw_stones (name,{(xx0+w-1),yy0}, {0,1},h)   
  58. end
  59.  
  60. y0=3
  61. x0=3
  62. draw_border_SS("st-rock1",x0,y0,8,8)
  63. x0=11
  64. x0=20
  65. draw_border_SS("st-rock1",x0,y0,8,8)
  66. x0=28
  67. draw_border_SS("st-rock1",x0,y0,8,8)
  68.  
  69. y0=14
  70. x0=3
  71. draw_border_SS("st-rock1",x0,y0,8,8)
  72. x0=11
  73. draw_border_SS("st-death",x0,y0,8,8)
  74. x0=20
  75. draw_border_SS("st-rock1",x0,y0,8,8)
  76. x0=28
  77. draw_border_SS("st-rock1",x0,y0,8,8)
  78.  
  79. -----------------------------------------------------------------------------------------
  80.  
  81. -- Box 1
  82. y0=3
  83. x0=3
  84. set_stone("st-bolder", x0+4,y0-2, {name="startbolder", direction=SOUTH}) 
  85. fakeoxyd(x0+4,y0-1)
  86. set_stone("st-switch", 0, 14, {action="callback", target="start"})
  87.  
  88. function start()
  89.         kill_stone(7,2) --blocker weg
  90. end
  91.  
  92. kill_stone(x0+4,y0)
  93. draw_items("it-seed",{x0+4,y0}, {0,1},2)
  94. set_stone("st-rock1",x0+3,y0+3)
  95. draw_stones("st-rock1",{x0+4,y0+6}, {1,0},3)
  96. draw_stones("st-rock1",{x0+1,y0+4}, {0,1},3)
  97. set_stone("st-rock1",x0+4,y0+4)
  98. draw_stones("st-rock1",{x0+6,y0+1}, {0,1},3)
  99.  
  100. set_stone("st-wood",x0+2,y0+2)
  101. set_stone("st-wood",x0+5,y0+3)
  102. set_stone("st-wood",x0+2,y0+5)
  103. oxyd(x0+5,y0+1)
  104.  
  105. document(x0+6,y0+5,"shh...listen!")
  106.  
  107. set_item("it-trigger", x0+3,y0+1, {invisible=1,action="callback", target="box1trig1"})
  108. set_item("it-trigger", x0+3,y0+2, {invisible=1,action="callback", target="box1trig2"})
  109. set_item("it-trigger", x0+4,y0+2, {invisible=1,action="callback", target="box1trig3"})
  110.  
  111. -- Ansrechbar als %door1
  112. local door1 = set_stone("st-door-v", x0+7, y0+5)
  113.  
  114. -- Ansprechbar als %switchesbox1
  115. local switchesbox1={0, 0, 0}
  116. doorsopenbox1=0
  117.  
  118. function box1trig1 () triggerbox1(1) end 
  119. function box1trig2 () triggerbox1(2) end 
  120. function box1trig3 () triggerbox1(3) end 
  121.  
  122. function triggerbox1(num)
  123.    %switchesbox1[num] = 1-%switchesbox1[num]
  124.    allbox1=1
  125.    for x=1,3 do
  126.       if (%switchesbox1[x]==0) then
  127.          allbox1 = 0
  128.       end
  129.    end
  130.    if (doorsopenbox1==0 and allbox1==1) then
  131.       enigma.SendMessage(%door1, "open", nil)
  132.       doorsopenbox1 = 1
  133.    elseif (doorsopenbox1==1 and allbox1==0) then
  134.       enigma.SendMessage(%door1, "close", nil)
  135.       doorsopenbox1 = 0
  136.    end
  137. end
  138. -----------------------------------------------------------------------------------------
  139. y0=3
  140. x0=11
  141. -- Box 2
  142. fill_stones("st-rock1",x0,y0,8,2)
  143. fill_stones("st-rock1",x0,y0,2,5)
  144. fill_stones("st-rock1",x0+6,y0,2,8)
  145. enigma.KillStone(x0+4, y0)
  146. enigma.KillStone(x0+4, y0+1)
  147. draw_stones("st-rock1",{x0,y0+7}, {1,0},8 )
  148. draw_floor("fl-water",{x0+4,y0}, {0,1},2 )
  149. set_floor("fl-water",x0,y0+6)
  150. set_floor("fl-water",x0+4,y0+3)
  151.  
  152. set_stone("st-thief",x0+1,y0+1)
  153. set_stone("st-thief",x0+2,y0+1)
  154. oxyd(x0,y0+2)
  155. enigma.KillStone(x0+1, y0+2)
  156. set_stone("st-thief",x0+1,y0+3)
  157. set_stone("st-thief",x0+2,y0+3)
  158. set_stone("st-rock1",x0+2,y0+4)
  159.  
  160. set_item("it-magicwand",x0+3,y0+3)
  161.  
  162. set_stone("st-wood",x0+3,y0+5)
  163. set_stone("st-wood",x0+4,y0+5)
  164. set_stone("st-wood",x0+4,y0+6)
  165.  
  166. set_item("it-trigger", x0+5,y0+3, {action="callback", target="box2trig1"})
  167. set_item("it-trigger", x0+5,y0+4, {action="callback", target="box2trig2"})
  168. set_item("it-trigger", x0+3,y0+6, {action="callback", target="box2trig3"})
  169.  
  170. local switchesbox2={0, 0, 0}
  171. doorsopenbox2=0
  172.  
  173. function box2trig1 () triggerbox2(1) end 
  174. function box2trig2 () triggerbox2(2) end 
  175. function box2trig3 () triggerbox2(3) end 
  176.  
  177. function triggerbox2(num)
  178.    %switchesbox2[num] = 1-%switchesbox2[num]
  179.    allbox2=1
  180.    for x=1,3 do
  181.       if (%switchesbox2[x]==0) then
  182.          allbox2 = 0
  183.       end
  184.    end
  185.    if (doorsopenbox2==0 and allbox2==1) then
  186.       draw_floor("fl-wood",{15,3}, {0,1},2 )  -- feste Koordinaten
  187.       doorsopenbox2 = 1
  188.    elseif (doorsopenbox2==1 and allbox2==0) then
  189.       draw_floor("fl-water",{15,3}, {0,1},2 )  -- feste Koordinaten
  190.       doorsopenbox2 = 0
  191.    end
  192. end
  193. -----------------------------------------------------------------------------------------
  194. y0=3
  195. x0=20
  196. -- Box 3
  197. fill_stones("st-rock1",x0+1,y0+1,2,3)
  198. fill_stones("st-rock1",x0+5,y0+1,2,2)
  199. draw_stones("st-rock1",{x0+1,y0+6}, {1,0},3)
  200. set_stone("st-rock1",x0+4,y0+4)
  201. set_stone("st-door",x0+3,y0,{name="door3", type="h"})
  202. set_stone("st-coinslot",x0+2,y0,{action="openclose", target="door3"})
  203.  
  204. oxyd(x0+1,y0+3)
  205.  
  206. set_stone("st-wood",x0+3,y0+4)
  207. set_stone("st-wood",x0+4,y0+5)
  208. set_stone("st-wood",x0+5,y0+5)
  209.  
  210. set_stone("st-bolder", x0+11,y0+5, {name="bolder1",direction=EAST}) -- in Box4
  211. set_stone("st-blocker", x0+7,y0+5, {name="blocker2"})
  212. set_stone("st-blocker", x0+8,y0+5, {name="blocker3"})
  213.  
  214. set_item("it-trigger", x0+4,y0+3, {action="callback", target="box3trig1"})
  215. set_item("it-trigger", x0+5,y0+3, {action="callback", target="box3trig2"})
  216. set_item("it-trigger", x0+3,y0+5, {action="callback", target="box3trig3"})
  217.  
  218. local switchesbox3={0, 0, 0}
  219. doorsopenbox3=0
  220.  
  221. function box3trig1 () triggerbox3(1) end 
  222. function box3trig2 () triggerbox3(2) end 
  223. function box3trig3 () triggerbox3(3) end 
  224.  
  225. function triggerbox3(num)
  226.    %switchesbox3[num] = 1-%switchesbox3[num]
  227.    allbox3=1
  228.    for x=1,3 do
  229.       if (%switchesbox3[x]==0) then
  230.          allbox3 = 0
  231.       end
  232.    end
  233.    if (doorsopenbox3==0 and allbox3==1) then
  234.       enigma.SendMessage(enigma.GetNamedObject("bolder1"), "direction", WEST)
  235.       doorsopenbox3 = 1
  236.    elseif (doorsopenbox3==1 and allbox3==0) then
  237.       enigma.SendMessage(enigma.GetNamedObject("bolder1"), "direction", EAST)
  238.       doorsopenbox3 = 0
  239.    end
  240. end
  241. -----------------------------------------------------------------------------------------
  242. y0=3
  243. x0=28
  244. -- Box 4
  245. draw_stones("st-rock1",{x0+1,y0+1}, {1,0},2 )
  246. draw_stones("st-rock1",{x0+6,y0+1}, {0,1},6 )
  247. set_stone("st-rock1",x0+4,y0+2)
  248. set_stone("st-rock1",x0+3,y0+4)
  249. set_stone("st-rock1",x0+4,y0+6)
  250. set_stone("st-bombs",x0+5,y0+5)
  251. set_stone("st-bombs",x0+5,y0+6)
  252. set_stone("st-bombs",x0+5,y0+7)
  253. set_stone("st-grate2",x0+4,y0+5)
  254.  
  255. draw_stones("st-wood",{x0+2,y0+2}, {0,1},2 )
  256. set_stone("st-wood",x0+3,y0+3)
  257. oxyd(x0+6,y0+5)
  258. bomb1 = set_item("it-blackbomb",x0+4,y0+5)
  259. --draw_items("it-blackbomb",{x0+5,y0+5}, {0,1},3)
  260.  
  261. set_item("it-trigger", x0+5,y0+1, {action="callback", target="box4trig1"})
  262. set_item("it-trigger", x0+4,y0+4, {action="callback", target="box4trig2"})
  263. set_item("it-trigger", x0+2,y0+3, {action="callback", target="box4trig3"})
  264. set_item("it-trigger", x0+2,y0+4, {action="callback", target="box4trig4"})
  265.  
  266. local switchesbox4={0, 0, 0, 0}
  267. exploded=0
  268.  
  269. function box4trig1 () triggerbox4(1) end 
  270. function box4trig2 () triggerbox4(2) end 
  271. function box4trig3 () triggerbox4(3) end    
  272. function box4trig4 () triggerbox4(4) end 
  273.  
  274. function triggerbox4(num)
  275.    %switchesbox4[num] = 1-%switchesbox4[num]
  276.    allbox4=1
  277.    for x=1,4 do
  278.       if (%switchesbox4[x]==0) then
  279.          allbox4 = 0
  280.       end
  281.    end
  282.    if (allbox4==1 and exploded==0) then
  283.       enigma.SendMessage(bomb1, "explode", nil)
  284.       exploded=1
  285.    end
  286. end
  287. -----------------------------------------------------------------------------------------
  288. y0=14
  289. x0=3
  290. -- Box 5
  291. enigma.KillStone(x0+3, y0)
  292. set_stone("st-key_a",x0+2,y0, {action="openclose", target="door4"})
  293. doorh( x0+3,y0, {name="door4"})
  294. draw_stones("st-rock1",{x0+3,y0+3}, {0,1},4 )
  295. draw_stones("st-rock1",{x0+6,y0+1}, {0,1},3 )
  296. set_stone("st-rock1",x0+1,y0+1)
  297. set_stone("st-rock1",x0+5,y0+5)
  298.  
  299. draw_stones("st-wood",{x0+2,y0+2}, {1,0},3 )
  300. set_stone("st-wood",x0+1,y0+5)
  301.  
  302. set_stone("st-rock1_move",x0+2,y0+5)
  303. set_item("it-coin", x0+2,y0+5,{value=1})
  304. set_item("it-wormhole", x0+1,y0+5, {name="warp1",targetx="4.5", targety="18.5",strength=5})
  305.  
  306. oxyd(x0+3,y0+5)
  307.  
  308. set_item("it-trigger", x0+3,y0+1, {action="callback", target="box5trig1"})
  309. set_item("it-trigger", x0+6,y0+4, {action="callback", target="box5trig2"})
  310. set_item("it-trigger", x0+4,y0+2, {action="callback", target="box5trig3"})
  311.  
  312. local switchesbox5={0, 0, 0}
  313. doorsopenbox5=0
  314.  
  315. function box5trig1 () triggerbox5(1) end 
  316. function box5trig2 () triggerbox5(2) end 
  317. function box5trig3 () triggerbox5(3) end 
  318.  
  319. function triggerbox5(num)
  320.    %switchesbox5[num] = 1-%switchesbox5[num]
  321.    allbox5=1
  322.    for x=1,3 do
  323.       if (%switchesbox5[x]==0) then
  324.          allbox5 = 0
  325.       end
  326.    end
  327.    if (doorsopenbox5==0 and allbox5==1) then
  328.       set_attribs(enigma.GetNamedObject("warp1"), {targetx="12.5", targety="19.5",strength=0})   
  329.       doorsopenbox5 = 1
  330.    elseif (doorsopenbox5==1 and allbox5==0) then
  331.     set_attribs(enigma.GetNamedObject("warp1"), {targetx="4.5", targety="18.5",strength=5})
  332.       doorsopenbox5 = 0
  333.    end
  334. end
  335. -----------------------------------------------------------------------------------------
  336. y0=14
  337. x0=11
  338. -- Box 6
  339. enigma.KillStone(x0+5, y0)
  340. oxyd(x0,y0+4)
  341. local laser1 = laser(x0+6,y0+1,TRUE,WEST)
  342. draw_stones("st-death",{x0+4,y0+2}, {1,0},3 )
  343. draw_stones("st-death",{x0+1,y0+6}, {1,0},4 )
  344. set_stone("st-death",x0+1,y0+2)
  345. set_stone("st-death",x0+2,y0+4)
  346. set_stone("st-death",x0+4,y0+5)
  347.  
  348. draw_stones("st-wood",{x0+3,y0+3}, {0,1},2 )
  349. set_stone("st-wood",x0+5,y0+4)
  350.  
  351. set_item("it-trigger", x0+1,y0+3, {action="callback", target="box6trig1"})
  352. set_item("it-trigger", x0+2,y0+3, {action="callback", target="box6trig2"})
  353. set_item("it-trigger", x0+6,y0+3, {action="callback", target="box6trig3"})
  354. set_item("it-extralife", x0+2,y0+5)
  355.  
  356. -- Ansprechbar als %switches
  357. local switchesbox6={0, 0, 0}
  358. doorsopenbox6=0
  359.  
  360. function box6trig1 () triggerbox6(1) end 
  361. function box6trig2 () triggerbox6(2) end 
  362. function box6trig3 () triggerbox6(3) end 
  363.  
  364. function triggerbox6(num)
  365.    %switchesbox6[num] = 1-%switchesbox6[num]
  366.    allbox6=1
  367.    for x=1,3 do
  368.       if (%switchesbox6[x]==0) then
  369.          allbox6 = 0
  370.       end
  371.    end
  372.    if (doorsopenbox6==0 and allbox6==1) then
  373.       enigma.SendMessage(%laser1, "off", nil)
  374.       doorsopenbox6 = 1
  375.    elseif (doorsopenbox6==1 and allbox6==0) then
  376.     enigma.SendMessage(%laser1, "on", nil)
  377.       doorsopenbox6 = 0
  378.    end
  379. end
  380. -----------------------------------------------------------------------------------------
  381. y0=14
  382. x0=20
  383. -- Box 7
  384. fill_stones("st-glass1",x0+1,y0+1,3,2)
  385. draw_stones("st-glass1",{x0+6,y0+4}, {0,1},3 )
  386. draw_stones("st-glass1",{x0+5,y0+5}, {0,1},2 )
  387. set_stone("st-glass1",x0+6,y0+1)
  388. set_stone("st-glass1",x0+3,y0+3)
  389. set_stone("st-glass1",x0+1,y0+6)
  390.  
  391. local door2 = set_stone("st-door-v",x0+7,y0+3)
  392.  
  393. set_stone("st-glass1",x0+4,y0)
  394.  
  395. set_stone("st-wood",x0+4,y0+3)
  396. set_stone("st-wood",x0+5,y0+3)
  397. set_stone("st-wood",x0+4,y0+5)
  398.  
  399. kill_stone(x0+5,y0)
  400. set_item("it-crack", x0+5,y0, {type=3})
  401. set_stone("st-glass1_hole",x0+5,y0)
  402.  
  403. oxyd(x0+2,y0+2)
  404.  
  405. set_item("it-trigger", x0+1,y0+3, {action="callback", target="box7trig1"})
  406. set_item("it-trigger", x0+1,y0+5, {action="callback", target="box7trig2"})
  407. set_item("it-trigger", x0+2,y0+6, {action="callback", target="box7trig3"})         
  408.  
  409. local switchesbox7={0, 0, 0}
  410. doorsopenbox7=0
  411.  
  412. function box7trig1 () triggerbox7(1) end 
  413. function box7trig2 () triggerbox7(2) end 
  414. function box7trig3 () triggerbox7(3) end 
  415.  
  416. function triggerbox7(num)
  417.    %switchesbox7[num] = 1-%switchesbox7[num]
  418.    allbox7=1
  419.    for x=1,3 do
  420.       if (%switchesbox7[x]==0) then
  421.          allbox7 = 0
  422.       end
  423.    end     
  424.    if (doorsopenbox7==0 and allbox7==1) then
  425.       set_stone("st-glass1_hole",24,14)
  426.       enigma.SendMessage(%door2, "open", nil)
  427.       doorsopenbox7 = 1
  428.    elseif (doorsopenbox7==1 and allbox7==0) then
  429.       set_stone("st-glass1",24,14)
  430.       enigma.SendMessage(%door2, "close", nil)
  431.       doorsopenbox7 = 0
  432.    end
  433. end
  434. -----------------------------------------------------------------------------------------
  435. y0=14
  436. x0=28
  437. -- Box 8
  438. draw_stones("st-rock1",{x0+1,y0+1}, {1,0},6 )
  439. draw_stones("st-rock1",{x0+1,y0+5}, {1,0},4 )
  440. set_stone("st-rock1",x0+4,y0+6)
  441. set_stone("st-glass",x0+2,y0+3)
  442. set_stone("st-glass",x0+4,y0+3)
  443.  
  444. kill_stone(x0,y0+3)
  445.  
  446. set_stone("st-rock1_move",x0+2,y0+4)
  447. set_stone("st-rock1_move",x0+5,y0+4)
  448. set_stone("st-rock1_move",x0+6,y0+5)
  449.  
  450. set_item("it-trigger", x0+1,y0+2, {action="callback", target="box8trig1"})
  451. set_item("it-trigger", x0+5,y0+2, {action="callback", target="box8trig2"})
  452. set_item("it-trigger", x0+6,y0+4, {action="callback", target="box8trig3"})
  453. set_item("it-trigger", x0,y0+3, {action="callback", target="box8trig4"})
  454.  
  455. local laser2 = laser(x0+1,y0+6,FALSE,EAST)
  456. oxyd(x0+3,y0+6)
  457.  
  458. local switchesbox8={0, 0, 0, 0}
  459. doorsopenbox8=0
  460.  
  461. function box8trig1 () triggerbox8(1) end 
  462. function box8trig2 () triggerbox8(2) end 
  463. function box8trig3 () triggerbox8(3) end 
  464. function box8trig4 () triggerbox8(4) end 
  465.  
  466. function triggerbox8(num)
  467.    %switchesbox8[num] = 1-%switchesbox8[num]
  468.    allbox8=1
  469.    for x=1,4 do
  470.       if (%switchesbox8[x]==0) then
  471.          allbox8 = 0
  472.       end
  473.    end
  474.    if (doorsopenbox8==0 and allbox8==1) then
  475.       enigma.SendMessage(%laser2, "on", nil)
  476.       doorsopenbox8 = 1
  477.    elseif (doorsopenbox8==1 and allbox8==0) then
  478.       enigma.SendMessage(%laser2, "off", nil)
  479.       doorsopenbox8 = 0
  480.    end
  481. end
  482.  
  483. oxyd_shuffle()
  484.