1
-- Island of Mirrors -- Oxyd Extra -- the Enigma Level
2
-- (c) 2002 Petr Machata/ant_39
3
-- Licensed under GPL v2.0 or above
6
dofile(enigma.FindDataFile("levels/ant.lua"))
7
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
9
function engine(x, y, delta, faces, attribs, modattrib, modvalues)
14
local fname = "switchfunc"..num
16
attribs[1].action = "callback"
17
attribs[1].target = fname
19
local x2, y2 = x+delta[1], y+delta[2]
20
set_stone(faces[1], x, y, attribs[1])
21
it.tgt = set_stone(faces[2], x2, y2, attribs[2])
23
local func0 = function()
25
%it.state = %it.state +1
26
if (%it.state>getn(%modvalues)) then
29
-- set state of desired target object
31
%attribs[2][%modattrib] = %modvalues[%it.state]
32
set_stone(%faces[2], %x2, %y2, %attribs[2])
33
--set_attrib(%it.tgt, %modattrib, %modvalues[%it.state])
36
setglobal(fname, func0)
38
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40
local dlt = {11,0} -- delta
41
local mir3 = {"st-switch", "st-3mirror"}
42
local mirp = {"st-switch", "st-pmirror"}
43
local lsr = {"st-switch", "st-laser"}
44
local trn = {transparent=TRUE, movable = TRUE}
45
local ntr = {transparent=FALSE, movable = FALSE}
50
cells[" "] = cell{floor="fl-samba"}
51
cells["#"] = cell{stone="st-rock5"}
52
cells["O"] = cell{actor={"ac-blackball", {player=0}}}
54
cells["A"] = cell{{{engine, dlt, mir3, {{},{orientation=3}}, "orientation", {3,4}}}}
55
cells["B"] = cell{{{engine, dlt, mirp, {{},{orientation=2}}, "orientation", {2,3}}}}
56
cells["C"] = cell{{{engine, dlt, mir3, {{},{orientation=1}}, "orientation", {1,2}}}}
57
cells["D"] = cell{{{engine, dlt, mir3, {{},{orientation=1}}, "orientation", {1,2}}}}
58
cells["E"] = cell{{{engine, dlt, mirp, {{},{transparent=TRUE, orientation=1}}, "orientation", {1,2}}}}
59
cells["F"] = cell{{{engine, dlt, mir3, {{},{orientation=2}}, "orientation", {2,3}}}}
60
cells["G"] = cell{{{engine, dlt, mirp, {{},{orientation=1}}, "orientation", {1,2}}}}
61
cells["H"] = cell{{{engine, dlt, mir3, {{},{orientation=2}}, "orientation", {2,3}}}}
62
cells["L"] = cell{stone={"st-laser", {on=FALSE, dir=NORTH, name="laser1"}}}
63
cells["S"] = cell{{{switch, "laser1", "onoff"}}}
66
"....................",
67
"....................",
68
".#...#.......0...0..",
76
"....S...#......L.0..",
77
"....................",
78
"....................",
80
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
81
oxyd_default_flavor="c"
82
set_default_parent(cells[" "])
83
create_world_by_map(level)