Hi All, Please test the attached Enigma Level in Enigma 1.20.
Any comments will be appreciated. You can use the Enigma-deval method or send direct to me at rayrw...@aol.com. I hope it works for you and that you enjoy it. Thank you, Ray - Sentfrom Ray Wick without any free advertisement for any companies.
<?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="Inverse Pyramid" el:subtitle=" -----> This level has OXYDs beneeth other OXYDs." el:id="RayWick023"/> <el:version el:score="1" el:release="1" el:revision="0" el:status="test"/> <el:author el:name="Ray Wick" el:email="rayrw...@aol.com" el:homepage="www.rayrwick.net/raywick/"/> <el:copyright>Copyright © Ray Wick</el:copyright> <el:license el:type="Donated to Enigma under the projects license" el:open="true"/> <el:compatibility el:enigma="1.20"> <el:dependency el:path="lib/liblua" el:id="lib/liblua" el:release="1" el:preload="true"/> <el:dependency el:path="lib/libmath" el:id="lib/libmath" el:release="1" el:preload="true"/> </el:compatibility> <el:modes el:easy="true" el:single="true" el:network="false"/> <el:comments> <el:code>Home File Name raywick023_1-0_1-20.xml</el:code> </el:comments> <el:score el:easy="03:35" el:difficult="05:21"/> </el:info> <el:luamain><![CDATA[ -- == == == == == == == == == == == == == == == == == == == == == == == == == == -- ### Global Definitions ############################################################################ -- === Random ========================================================================================= math.randomseed() -- === World ========================================================================================== wo["ConserveLevel"] = true wo["AllowSingleOxyds"] = true -- === Level Mode Definitions ========================================================================= if wo["IsDifficult"] then ti[":"] = {"it_seed", _tree = true} bgn = 1 else ti[":"] = {"it_seed_hay", _tree = true} bgn = 2 end -- === Tile Definitions =============================================================================== ti["@"] = {"#ac_marble_black"} ti[" "] = {"fl_hay"} ti[","] = {"fl_water", "spot_L1#"} ti["#"] = {"st_box_wood"} ti["F"] = {"st_fake_oxydd"} ti["~"] = {"fl_water"} ti[",2"] = ti["~"] .. {"st_oxyd_d", oxydcolor = OXYD_BLACK, target = "oxyd_callback"} ti["Q"] = {"st_oxyd", flavor = "a", oxydcolor = OXYD_WHITE, target = "oxyd_callback"} ti["R"] = {"st_oxyd", flavor = "b", oxydcolor = OXYD_WHITE, target = "oxyd_callback"} ti["S"] = {"st_oxyd", flavor = "c", oxydcolor = OXYD_BLACK, target = "oxyd_callback"} ti["T"] = ti["~"] .. {"st_oxyd", flavor = "c", oxydcolor = OXYD_WHITE, target = "oxyd_callback"} -- === Table Definitions ============================================================================== oxyds_L1 = {OXYD_PURPLE, OXYD_GRAY, OXYD_CYAN, OXYD_BLUE, OXYD_GREEN, OXYD_PINE} for j = 1, #oxyds_L1 do ti["O" .. oxyds_L1[j]] = ti{"fl_water"} .. {"st_oxyd_d", oxydcolor = oxyds_L1[j], target = "oxyd_callback", flavor = "d"} end local col_L2 = { [1] = OXYD_ORANGE, [2] = OXYD_BROWN, [3] = OXYD_YELLOW, [4] = OXYD_RED, [5] = OXYD_ORANGE, [6] = OXYD_BROWN, [7] = OXYD_YELLOW, [8] = OXYD_RED, [9] = OXYD_ORANGE, [10] = OXYD_BROWN, [11] = OXYD_YELLOW, [12] = OXYD_RED, [13] = OXYD_ORANGE, [14] = OXYD_BROWN, [15] = OXYD_YELLOW, [16] = OXYD_RED, [17] = OXYD_ORANGE, [18] = OXYD_BROWN, [19] = OXYD_YELLOW, [20] = OXYD_RED, [21] = OXYD_ORANGE, [22] = OXYD_BROWN, [23] = OXYD_YELLOW, [24] = OXYD_RED, [25] = OXYD_RED, [26] = OXYD_RED, } -- local col_L2 = no["col_L2"]:shuffle() w, h = wo(ti, " ", { -- 01234567890123456789 "####################", "# #", "# #", "# ,,,,,,, #", "# ,,,,,,, #", "# ,,,,,,, #", "# @ ,,,F,,, #", "# ,,,,,,, #", "# ,,,,,,, #", "# ,,,,,,, #", "# #", "# #", "####################" }) spots_L1 = po(no["spot_L1#*"]:shuffle()) colors_L1 = lib.math.permutation(#spots_L1) -- colors_L2 = lib.math.permutation(26) for j = 1, (#spots_L1) do local color_L1 = oxyds_L1[colors_L1[j] % (#oxyds_L1) + 1] wo[spots_L1[j]] = ti["O" .. color_L1] end -- ### Function Definitions ########################################################################## last_oxyd = 0 cnt_L2 = 0 function oxyd_callback(is_on, sender) if bgn == 1 then cnt_L2 = cnt_L2 + 1 wo[{10, 6}] = ti{"fl_water"} .. {"st_oxyd", flavor = "d", oxydcolor = col_L2[cnt_L2], target = "oxyd_callback"} bgn = 0 end if bgn == 2 then wo[{10, 6}] = ti[",2"] bgn = 0 end if sender.state == OXYDPAIR then oxyds = grp(sender, last_oxyd) if sender.flavor == "d" then if (((sender.y == 4) or (sender.y == 5) or (sender.y == 6) or (sender.y == 7) or (sender.y == 8)) and ((sender.x == 8) or (sender.x == 9) or (sender.x == 10) or (sender.x == 11) or (sender.x == 12))) then makeoxyd(sender, sender.flavor) else makefloor(sender) end end if sender.flavor == "c" then if (((sender.y == 5) or (sender.y == 6) or (sender.y == 7)) and ((sender.x == 9) or (sender.x == 10) or (sender.x == 11))) then makeoxyd(sender, sender.flavor) else makefloor(sender) end end if sender.flavor == "b" then if (sender.y == 6) and (sender.x == 10) then makeoxyd(sender, sender.flavor) else makefloor(sender) end end if sender.flavor == "a" then makefloor(sender) end if last_oxyd.flavor == "d" then if (((last_oxyd.y == 4) or (last_oxyd.y == 5) or (last_oxyd.y == 6) or (last_oxyd.y == 7) or (last_oxyd.y == 8)) and ((last_oxyd.x == 8) or (last_oxyd.x == 9) or (last_oxyd.x == 10) or (last_oxyd.x == 11) or (last_oxyd.x == 12))) then makeoxyd(last_oxyd, last_oxyd.flavor) else makefloor(last_oxyd) end end if last_oxyd.flavor == "c" then if (((last_oxyd.y == 5) or (last_oxyd.y == 6) or (last_oxyd.y == 7)) and ((last_oxyd.x == 9) or (last_oxyd.x == 10) or (last_oxyd.x == 11))) then makeoxyd(last_oxyd, last_oxyd.flavor) else makefloor(last_oxyd) end end if last_oxyd.flavor == "b" then if (last_oxyd.y == 6) and (last_oxyd.x == 10) then makeoxyd(last_oxyd, last_oxyd.flavor) else makefloor(last_oxyd) end end if last_oxyd.flavor == "a" then makefloor(last_oxyd) end it(oxyds):grow() elseif sender.state == OPEN then last_oxyd = sender end end function makefloor(whareat) wo[whareat] = ti[":"] fl(whareat)._tree = true return end function makeoxyd(whareat, flav) if flav == "a" then wo[whareat] = ti["T"] end if flav == "b" then wo[whareat] = ti["Q"] end if flav == "c" then wo[whareat] = ti["R"] end if flav == "d" then if wo["IsDifficult"] then cnt_L2 = cnt_L2 + 1 wo[whareat] = {"st_oxyd", flavor = "c", oxydcolor = col_L2[cnt_L2], target = "oxyd_callback"} else wo[whareat] = ti["S"] end end return end -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- wo:shuffleOxyd() -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ]]></el:luamain> <el:i18n> <el:string el:key="title"> <el:english el:translate="false"/> </el:string> <el:string el:key="subtitle"> <el:english el:translate="true"/> </el:string> </el:i18n> </el:protected> </el:level>
_______________________________________________ Enigma-devel mailing list Enigma-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/enigma-devel