~ubuntu-branches/ubuntu/saucy/enigma/saucy

« back to all changes in this revision

Viewing changes to data/levels/enigma_viii/andreas49_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="Weirdly Wired" el:subtitle="" el:id="andreas49"/>
 
6
      <el:version el:score="1" el:release="1" el:revision="11" el:status="released"/>
 
7
      <el:author el:name="Andreas Lochmann" el:email="" el:homepage=""/>
 
8
      <el:copyright>Copyright © 2008, 2009 Andreas Lochmann</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="0:37" el:difficult="8:49"/>
 
15
    </el:info>
 
16
    <el:luamain><![CDATA[
 
17
 
 
18
ti[" "] = {"fl_sahara", friction = 3.5, adhesion = 4.0}
 
19
ti["a"] = {"fl_ivory", friction = 3.5, adhesion = 4.0}
 
20
ti["b"] = {"fl_bright", friction = 3.5, adhesion = 4.0}
 
21
ti["c"] = {"fl_platinum", friction = 3.5, adhesion = 4.0}
 
22
ti["_"] = {"fl_water"}
 
23
ti["@"] = {"#ac_marble_black"}
 
24
ti["w"] = {"st_flat_movable", "wood#"}
 
25
ti["t"] = {"it_trigger", "trigger#"}
 
26
ti["d"] = {"st_blocker", "door#"}
 
27
ti["o"] = {"st_oxyd", oxydcolor = OXYD_YELLOW, flavor = "a"}
 
28
ti["O"] = {"st_oxyd", oxydcolor = OXYD_WHITE, flavor = "a"}
 
29
ti["1"] = {"st_panel", cluster = 1}
 
30
ti["2"] = {"st_panel", cluster = 2}
 
31
ti["S"] = {"st_switch", target = "easy_mode_call"}
 
32
 
 
33
floors  = {ti[" "], ti["a"], ti["b"], ti["c"]}
 
34
polynom = lib.math.random_vector(10, 4)
 
35
 
 
36
function myresolver(key, x, y)
 
37
  if key == " " then
 
38
    return floors[lib.math.cubic_polynomial(polynom, x, y) % (#floors) + 1]
 
39
  elseif    (key == "#")
 
40
         or ((key == "_") and (random(4) == 1))
 
41
         or ((key == "S") and wo["IsDifficult"]) then
 
42
    return ti[""..random(2)]
 
43
  else
 
44
    return ti[key]
 
45
  end
 
46
end
 
47
 
 
48
w, h = wo(myresolver, " ", {
 
49
 -- 01234567890123456789
 
50
   "####################___________________",
 
51
   "#                  #_____###o###_______",
 
52
   "#   w   w t   t    #_____#d   d#_______",
 
53
   "#     w   w t   t  #___### ### ###_____",
 
54
   "#  w     t         #___#d d#_#d d#_____",
 
55
   "#                  ##### ###_### ###___",
 
56
   "S    w   w t @ t        d#___#_#d d#___",
 
57
   "#                  #######_####### #___",
 
58
   "#  w     t         #_______O  d# # o___",
 
59
   "#     w   w t   t  #_______### ### #___",
 
60
   "#   w   w t   t    #_________#d   d#___",
 
61
   "#                  #_________###O###___",
 
62
   "####################___________________"
 
63
})
 
64
 
 
65
door_p = lib.math.permutation(12)
 
66
wire_p = lib.math.permutation(12)
 
67
woods = no["wood#*"]
 
68
triggers = no["trigger#*"]
 
69
doors = no["door#*"]
 
70
 
 
71
for j = 1, 12 do
 
72
  triggers[j].target = doors[door_p[j]]
 
73
end
 
74
 
 
75
for j = 1, 9 do
 
76
  wo:add({"ot_wire",
 
77
          anchor1 = woods[wire_p[j + 3]],
 
78
          anchor2 = woods[wire_p[j%3 + 1]]})
 
79
  wo:add({"ot_wire", name = "obsolete_wire#",
 
80
          anchor1 = woods[wire_p[j + 3]],
 
81
          anchor2 = woods[wire_p[j%9 + 4]]})
 
82
end
 
83
 
 
84
function easy_mode_call(is_on, sender)
 
85
  if is_on then
 
86
    no["obsolete_wire#*"]:kill()
 
87
  else
 
88
    for j = 1, 9 do
 
89
      wo:add({"ot_wire", name = "obsolete_wire#",
 
90
              anchor1 = woods[wire_p[j + 3]],
 
91
              anchor2 = woods[wire_p[j%9 + 4]]})
 
92
    end
 
93
  end
 
94
end
 
95
    ]]></el:luamain>
 
96
    <el:i18n>
 
97
      <el:string el:key="title">
 
98
        <el:english el:translate="false"/>
 
99
      </el:string>
 
100
    </el:i18n>
 
101
  </el:protected>
 
102
</el:level>