~ubuntu-branches/ubuntu/raring/enigma/raring

« back to all changes in this revision

Viewing changes to data/levels/enigma_ix/ral32_1.xml

  • Committer: Bazaar Package Importer
  • Author(s): Erich Schubert
  • Date: 2010-05-26 02:27:26 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100526022726-7tnbf65s6btbibu2
Tags: 1.10~~pre-alpha+r2100-1
* New SVN checkout, shortly after upstream "pre-alpha" release
* Target unstable, to get more testing for enigma
* Remove spelling patches included upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
 
2
<el:level xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://enigma-game.org/schema/level/1 level.xsd" xmlns:el="http://enigma-game.org/schema/level/1">
 
3
  <el:protected >
 
4
    <el:info el:type="level">
 
5
      <el:identity el:title="Panelled Puzzle I" el:subtitle="" el:id="20080820ral639"/>
 
6
      <el:version el:score="1" el:release="1" el:revision="$Revision: 179 $" el:status="released"/>
 
7
      <el:author  el:name="Ronald Lamprecht" el:email="ral@users.berlios.de"/>
 
8
      <el:copyright>Copyright © 2008,2009 Ronald Lamprecht</el:copyright>
 
9
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
 
10
      <el:compatibility el:enigma="1.10">
 
11
        <el:dependency el:path="lib/libmath" el:id="lib/libmath" el:release="1" el:preload="true"/>
 
12
      </el:compatibility>
 
13
      <el:modes el:easy="true" el:single="true" el:network="false"/>
 
14
      <el:score el:easy="6:01" el:difficult="7:53"/>
 
15
    </el:info>
 
16
    <el:luamain><![CDATA[
 
17
wo["ConserveLevel"] = true
 
18
 
 
19
ti[" "] = {"fl_blueslab_framed", "fl#", checkerboard=0} .. ti{"fl_platinum_framed", "fl#", friction=7, adhesion=2, checkerboard=1}
 
20
ti[":"] = {"fl_blueslab_framed", checkerboard=1} .. ti{"fl_platinum_framed", friction=7, adhesion=2, checkerboard=0}
 
21
ti["."] = {"fl_abyss"}
 
22
ti["+"] = {"fl_abyss", "oxydpos#"}
 
23
ti["#"] = {"st_panel", cluster=1}
 
24
 
 
25
ti["P"] = {"st_pull","westpull"}
 
26
 
 
27
ti["trigger"] = {"it_trigger", "tr%%", invisible=true, target="counter", action="signal"}
 
28
 
 
29
ti["*"] = {"st_spitter", "spitter", secure=true}
 
30
ti["X"] = {"st_pull", "eastpull"} .. ti{"fl_redslab_framed"} .. ti{"it_trigger", invisible=true, target="spitter"}
 
31
ti["S"] = {"st_dispenser_extralife"}
 
32
ti["$"] = {"it_extralife"}
 
33
 
 
34
ti["@"] = {"#ac_marble"}
 
35
 
 
36
if wo["IsDifficult"] then
 
37
    ti["?"] = {"it_document", text="solutionseven"}
 
38
else
 
39
    ti["?"] = {"it_nil"}
 
40
end
 
41
 
 
42
resolver = res.autotile(ti, {"A", "O", "trigger"})
 
43
 
 
44
w, h = wo(resolver, " ", {
 
45
".#....#....#....#.",
 
46
"########..########",
 
47
".#ABCD#+..+#@   #.",
 
48
".#EFGH#.++.* ?  #.",
 
49
".#IJKL#.++.S    #.",
 
50
".#MNOP#+..+#   X#.",
 
51
"########..########",
 
52
".#....#....#....#."
 
53
})
 
54
 
 
55
wo:add({"ot_wire", "wire", anchor1="westpull", anchor2="eastpull"})
 
56
wo:add({"ot_counter", "counter", state=15, target_0="conjure"})
 
57
 
 
58
connections = {"w","s","sw","e","ew","es","esw","n","nw","ns","nsw",
 
59
                "ne","new","nes","nesw"}
 
60
                
 
61
yellow = {true,true,false,true,true,false,false,true,false,true,false,false,false,false,false}
 
62
 
 
63
function parity(p)
 
64
    sum = 0
 
65
    for i = 2, 15 do
 
66
        for j = 1, i do
 
67
            sum = sum + cond(p[j] > p[i], 1, 0)
 
68
        end
 
69
    end
 
70
    return sum % 2
 
71
end
 
72
 
 
73
perm = lib.math.permutation(15)
 
74
if  (wo["IsDifficult"] and parity(perm) == 1) or 
 
75
        (not wo["IsDifficult"] and parity(perm) == 0) then
 
76
    perm[1], perm[2] = perm[2], perm[1]
 
77
end
 
78
state = 0  -- first even run for difficult mode
 
79
 
 
80
 
 
81
for i = 1, 15 do
 
82
    wo[no["tr%"..i]] = {"st_puzzle", connections=connections[perm[i]]}
 
83
    if not wo["IsDifficult"] and yellow[perm[i]] then
 
84
        wo[no["tr%"..i]] = {"st_puzzle_yellow", connections=connections[perm[i]]}
 
85
    end
 
86
end
 
87
 
 
88
function conjure()
 
89
    if state == 0 and wo["IsDifficult"] then
 
90
        -- now we play an odd parity
 
91
        perm = lib.math.permutation(15)
 
92
        if parity(perm) == 0 then
 
93
            perm[1], perm[2] = perm[2], perm[1]
 
94
        end
 
95
        for i = 1, 15 do
 
96
            wo[no["tr%"..i]] = {"st_puzzle", connections=connections[perm[i]]}
 
97
        end
 
98
        state = 1
 
99
        -- do indicate changed parity
 
100
        wo[no["fl#*"]] = ti[":"]
 
101
        wo[no["eastpull"]+{0,-1}] = {"it_document", text="solutionsodd"}
 
102
    else
 
103
        wo[no["oxydpos#*"]] = {"st_oxyd_d"}
 
104
        no["wire"]:kill()
 
105
    end
 
106
end
 
107
 
 
108
    ]]></el:luamain>
 
109
    <el:i18n>
 
110
      <el:string el:key="title">
 
111
        <el:english el:translate="false"/>
 
112
      </el:string>
 
113
      <el:string el:key="solutionseven">
 
114
        <el:english el:translate="true" >There are 56 fully connected puzzle piece arrangements, but just 34 of them are reachable from this first distribution.</el:english>
 
115
        <el:translation el:lang="de">Es gibt 56 Figuren mit voll verbundenen Puzzleteilen, aber ausgehend von der ersten Verteilung, können nur 34 dieser Figuren erreicht werden.</el:translation>
 
116
      </el:string>
 
117
      <el:string el:key="solutionsodd">
 
118
        <el:english el:translate="true" >This second distribution can just be converted to any of the other 28 arrangements.</el:english>
 
119
        <el:translation el:lang="de">Diese zweite Verteilung kann nun in jede der anderen 28 Figuren überführt werden.</el:translation>
 
120
      </el:string>
 
121
    </el:i18n>
 
122
  </el:protected>
 
123
</el:level>