~ubuntu-branches/ubuntu/edgy/enigma/edgy-backports

« back to all changes in this revision

Viewing changes to data/levels/oxe23.lua

  • Committer: Bazaar Package Importer
  • Author(s): Erich Schubert
  • Date: 2005-06-20 20:48:19 UTC
  • Revision ID: james.westby@ubuntu.com-20050620204819-ggqswr2gh3w9hhyr
Tags: upstream-0.92
ImportĀ upstreamĀ versionĀ 0.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- Island of Mirrors -- Oxyd Extra -- the Enigma Level
 
2
-- (c) 2002 Petr Machata/ant_39
 
3
-- Licensed under GPL v2.0 or above
 
4
-- 2003-02-21
 
5
 
 
6
dofile(enigma.FindDataFile("levels/ant.lua"))
 
7
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 
8
num = 0
 
9
function engine(x, y, delta, faces, attribs, modattrib, modvalues)
 
10
   local it = {}
 
11
   it.state = 1
 
12
 
 
13
   num = num +1
 
14
   local fname = "switchfunc"..num
 
15
 
 
16
   attribs[1].action = "callback"
 
17
   attribs[1].target = fname
 
18
 
 
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])
 
22
 
 
23
   local func0 = function()
 
24
                    -- switch
 
25
                    %it.state = %it.state +1
 
26
                    if (%it.state>getn(%modvalues)) then
 
27
                       %it.state = 1
 
28
                    end
 
29
                    -- set state of desired target object
 
30
                    kill_stone(%x2, %y2)
 
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])
 
34
                 end
 
35
 
 
36
   setglobal(fname, func0)
 
37
end
 
38
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 
39
 
 
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}
 
46
 
 
47
cells={}
 
48
cells["."] = abyss
 
49
cells["0"] = oxyd
 
50
cells[" "] = cell{floor="fl-samba"}
 
51
cells["#"] = cell{stone="st-rock5"}
 
52
cells["O"] = cell{actor={"ac-blackball", {player=0}}}
 
53
 
 
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"}}}
 
64
 
 
65
level = {
 
66
   "....................",
 
67
   "....................",
 
68
   ".#...#.......0...0..",
 
69
   ".       ....       .",
 
70
   ". A B C ....       0",
 
71
   ".       #...       .",
 
72
   ". D E F ...0       .",
 
73
   ".  O    ....       .",
 
74
   "# G   H ....       0",
 
75
   ".       ....       .",
 
76
   "....S...#......L.0..",
 
77
   "....................",
 
78
   "....................",
 
79
}
 
80
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 
81
oxyd_default_flavor="c"
 
82
set_default_parent(cells[" "])
 
83
create_world_by_map(level)
 
84
oxyd_shuffle()