<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<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">
  <el:protected>
    <el:info el:type="level">
      <el:identity el:title="Free Riders" el:subtitle="Left or Right Drive?" el:id="duffy155"/>
      <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
      <el:author  el:name="Jacob Scott" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2007 Jacob Scott</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="0.92">
      </el:compatibility>
      <el:modes el:easy="false" el:single="true" el:network="false"/>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
rooms_wide=1
rooms_high=1

levelw=1+(19*rooms_wide)
levelh=1+(12*rooms_high)

create_world( levelw, levelh)
enigma.ConserveLevel=FALSE

fill_floor("fl-hay", 0,0,levelw,levelh)

function renderLine( line, pattern)
    for i=1, strlen(pattern) do
        local c = strsub( pattern, i, i)
        if c =="#" then
            set_stone( "st-greenbrown", i-1, line)
        elseif c =="W" then
            set_stone( "st-white4", i-1, line)
        elseif c =="B" then
            set_stone( "st-black4", i-1, line)
        elseif c == "o" then
            oxyd( i-1, line)
        elseif c == "*" then
            set_stone( "st-brownie", i-1, line)
        elseif c == "!" then
            abyss(i-1,line)
        elseif c == "~" then
            set_floor("fl-water",i-1,line)
        elseif c=="z" then
            set_actor("ac-blackball", i-.5,line+.5, {player=0})
            set_item("it-yinyang",i-1,line)
        elseif c=="y" then
            set_actor("ac-whiteball", i-.5,line+.5, {player=1})
            set_item("it-yinyang",i-1,line)
        elseif c == "g" then
            draw_stones("st-grate1",{i-1,line}, {1,1}, 1)
        elseif c=="x" then
            puzzle(i-1,line,PUZ_1111)
        elseif c=="a" then
            set_item("it-trigger",i-1,line,{action="callback",target="funcc1"})
        elseif c=="b" then
            set_item("it-trigger",i-1,line,{action="callback",target="funcc2"})
        end
    end    
end

renderLine(00,"####################")
renderLine(01,"#oW       x    x Bo#")
renderLine(02,"#W     x    x     B#")
renderLine(03,"#g    x x    x    g#")
renderLine(04,"#g xxx        xxx g#")
renderLine(05,"#gxx xx   x  xx xxg#")
renderLine(06,"#ax z xx    xx y xb#")
renderLine(07,"#gxx xx  x   xx xxg#")
renderLine(08,"#g xxx  x     xxx g#")
renderLine(09,"#g         x      g#")
renderLine(10,"#W      x x  x    B#")
renderLine(11,"#oW x            Bo#")
renderLine(12,"####################")

oxyd_shuffle()

ff1=0
function funcc1()
    if ff1==0 then
        enigma.KillStone(1,6)
        enigma.KillStone(2,6)
        enigma.KillStone(3,6)
        enigma.KillStone(4,6)
        enigma.KillStone(5,6)
        enigma.KillStone(6,6)
        enigma.KillStone(7,6)
        enigma.KillStone(8,6)
        funcc3()
        ff1=1
    end
end

ff2=0
function funcc2()
    if ff2==0 then
        enigma.KillStone(18,6)
        enigma.KillStone(17,6)
        enigma.KillStone(16,6)
        enigma.KillStone(15,6)
        enigma.KillStone(14,6)
        enigma.KillStone(13,6)
        enigma.KillStone(12,6)
        enigma.KillStone(11,6)
        funcc3()
        ff2=1
    end
end

ff3=0
function funcc3()
    if ff3==0 then
        fill_floor("fl-water",9,0,2,13)
        ff3=1
    end
end
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="true"/>
        <el:translation el:lang="de">Trittbrettfahrer</el:translation>
      </el:string>
      <el:string el:key="subtitle">
        <el:english el:translate="true"/>
        <el:translation el:lang="de">Links- oder Rechtsverkehr</el:translation>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
