THE FARM, 2.0
<<silently>>\n<<set $lands =\n [ [ [".." // 0\n ,".."\n ]\n , ["'."\n ,",."\n ]\n , [".,"\n ,".'"\n ]\n , ["',"\n ,",'"\n ]\n ]\n , [ ["Oo" // 1\n ,"oO"\n ]\n , [",o"\n ,".O"\n ]\n , ["o."\n ,"O,"\n ]\n ]\n , [ ["==" // 2\n ,"=="\n ]\n ]\n , [ ["c=" // 3\n ,"=c"\n ]\n ]\n , [ ["Cc" // 4\n ,"cC"\n ]\n ]\n , [ ["CC" // 5\n ,"CC"\n ]\n ]\n , [ ["';" // 6\n ,'"' + "'"\n ]\n , ["'" + '"'\n ,":'"\n ]\n ]\n , [ ["=h" // 7\n ,"h="\n ]\n ]\n , [ ["hH" // 8\n ,"Hh"\n ]\n ]\n , [ ["HH" // 9\n ,"HH"\n ]\n ]\n , [ ["00" //10\n ,"YY"\n ]\n ]\n , [ ["++" //11\n ,"++"\n ]\n ]\n , [ ["--" //12\n ,"--"\n ]\n , ["~-"\n ,"-~"\n ]\n ]\n , [ [" " //13\n ," "\n ]\n ]\n , [ ["/A" //14\n ,"11"\n ]\n ]\n , [ [".," //15 (tree trunk)\n ,"11"\n ]\n , ["'."\n ,"11"\n ]\n ]\n , [ ["H~" //16\n ,"~H"\n ]\n ]\n , [ ["=," //17\n ,"=."\n ]\n , [".="\n ,",="\n ]\n , [".,"\n ,",."\n ]\n ]\n , [ [";@" //18\n ,"'*"\n ]\n , ["@'"\n ,"*;"\n ]\n ]\n , [ [",a" //19\n ,"ii"\n ]\n ]\n , [ ["/a" //20\n ,"tt"\n ]\n ]\n , [ ["~~" //21\n ,"~~"\n ]\n , ["~%"\n ,"%~"\n ]\n ]\n , [ [".o" //22\n ,"o,"\n ]\n , [".,"\n ,",."\n ]\n ]\n , [ ["-~" //23 (sand)\n ,"~-"\n ]\n , ["~-"\n ,"-~"\n ]\n ]\n , [ ["~~" //24 (dark water)\n ,"~~"\n ]\n , ["~%"\n ,"%~"\n ]\n ]\n , [ ["~~" //25 (black water)\n ,"~~"\n ]\n , ["~%"\n ,"%~"\n ]\n ]\n , [ ["~~" //26 (lava)\n ,"~~"\n ]\n , ["~%"\n ,"%~"\n ]\n ]\n , [ [".o" //27 (dark stone)\n ,"o,"\n ]\n , [".,"\n ,",."\n ]\n ]\n ]>>\n\n<<set $landstyles =\n [ [ "background-color:#080;color:#0f0;" // 0 (grass)\n , "background-color:#080;color:#0c0;"\n , "background-color:#070;color:#0c0;"\n , "background-color:#191;color:#0f0;"\n ]\n , [ "background-color:#ccc;color:#888;" // 1 (stone)\n , "background-color:#aaa;color:#888;"\n ]\n , [ "background-color:#380;color:#880;" // 2 (plowed land)\n , "background-color:#380;color:#aa0;"\n , "background-color:#370;color:#880;"\n , "background-color:#370;color:#aa0;"\n ]\n , [ "background-color:#370;color:#ba0;" // 3 (planted crops)\n , "background-color:#380;color:#dc0;"\n ]\n , [ "background-color:#470;color:#ed0;" // 4 (half-grown crops)\n ]\n , [ "background-color:#470;color:#fe2;" // 5 (harvestable crops)\n ]\n , [ "background-color:#040;color:#080;" // 6 (overgrown grass)\n , "background-color:#060;color:#0c0;"\n , "background-color:#060;color:#0a0;"\n ]\n , [ "background-color:#370;color:#0b4;" // 7 (planted herbs)\n , "background-color:#380;color:#0d6;"\n ]\n , [ "background-color:#470;color:#edf;" // 8 (white herbs)\n ]\n , [ "background-color:#470;color:#3d4;" // 9 (green herbs)\n ]\n , [ "background-color:#330;color:#660;" // 10 (wall) -- top\n , "background-color:#660;color:#330;" // -- wall\n ]\n , [ "background-color:#880;color:#660;" // 11 (floor)\n ]\n , [ "background-color:#660;color:#880;" // 12 (bare dirt)\n , "background-color:#550;color:#880;"\n ]\n , [ "" // 13 (void)\n ]\n , [ "background-color:#0f0;color:#080;" // 14 (tree) -- canopy\n , "background-color:#660;color:#440;" // -- trunk\n ]\n , [ "background-color:#080;color:#0c0;" // 15 (grass)\n , "background-color:#660;color:#440;" // -- trunk\n ]\n , [ "background-color:#470;color:#142;" // 16 (black herbs)\n ]\n , [ "" // 17 (decayed tilled field)\n ]\n , [ "background-color:#040;color:#080;" // 18 (bushes)\n , "background-color:#040;color:#f00;"\n ]\n , [ "" // 19 (tiny sapling)\n ]\n , [ "" // 20 (grown sapling)\n ]\n , [ "background-color:#008;color:#00f;" // 21 (water)\n , "background-color:#008;color:#0ff;"\n , "background-color:#048;color:#00f;"\n , "background-color:#03c;color:#004;"\n ]\n , [ "background-color:#888;color:#aaa;" // 22 (stone)\n , "background-color:#666;color:#ccc;"\n ]\n , [ "background-color:#cc6;color:#ff8;" // 23 (sand)\n , "background-color:#dd7;color:#ff8;"\n ]\n , [ "background-color:#006;color:#008;" // 24 (dark water)\n , "background-color:#026;color:#008;"\n , "background-color:#026;color:#000;"\n ]\n , [ "" // 25 (black water)\n , "color:#444;"\n , "color:#777;"\n , "color:#444;background-color:#111;"\n , "color:#777;background-color:#111;"\n ]\n , [ "color:#f00;background-color:#c00;" // 26 (lava)\n , "color:#800;background-color:#f00;"\n ]\n , [ "background-color:#444;color:#888;" // 27 (dark stone)\n , "background-color:#333;color:#666;"\n ]\n ]>>\n<<set $duskdawn =\n [ "background-color: #c00;color:#fc0;"\n , "background-color: #630;color:#f88;"\n , "background-color: #a40;color:#f00;"\n , "background-color: #800;color:#f88;"\n ]>>\n<<set $night =\n [ "background-color:#334;color:#222;"\n , "background-color:#111;color:#666;"\n , "background-color:#555;color:#222;"\n , "background-color:#222;color:#447;"\n , "background-color:#446;color:#333;"\n ]>>\n\n<<set $tools =\n [ ["hoe", [0, 6, 17]]\n , ["hammer", [0, 1, 10, 11]]\n , ["bag of seeds", [2]]\n , ["scythe", [5, 8, 9, 16, 18]]\n , ["herb bag", [2]]\n , ["axe", [14, 15, 19, 20]]\n\n , ["wall scaffold", [12]]\n , ["floor tile", [12]]\n ]>>\n\n<<set $tool = 2>>\n\n<<set $e =\n [ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15]\n , [13, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14]\n , [ 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]\n , [ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12]\n , [13, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11]\n , [ 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10]\n , [ 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n , [13, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6]\n , [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3]\n , [ 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0, 1, 2]\n , [ 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0, 1]\n , [ 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0]\n ]>>\n\n<<set $home =\n [ [ 0, 0, 0, 0, 6, 0, 0, 0, 0,18, 6, 0, 6, 6, 6, 6]\n , [ 6, 0,10,10,10,10, 0, 0,14, 6, 0, 1, 0, 6, 1, 6]\n , [14, 6,10,11,11,10, 0, 6, 0, 0,14, 0, 6,14, 6, 6]\n , [ 6, 6,10,11,11,10, 6,14, 0, 0, 0, 6, 0, 1, 6, 6]\n , [ 6, 6,10,10,11,10, 0, 0, 0, 6, 0,14, 1, 1, 0, 0]\n , [ 6, 6, 6, 0,12, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0,18]\n , [ 6,14, 2, 2,12, 2, 2, 0, 0, 6, 0, 0, 0,14, 1, 0]\n , [ 6, 0, 2, 2,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [12,12,12,12,12, 0, 0, 6, 0, 0, 0, 0, 6, 0, 0, 0]\n , [ 6, 6, 6, 0, 0, 0, 1, 0, 0, 0, 0, 6, 0, 0, 1, 6]\n , [ 6, 6,14, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0]\n , [ 6, 6, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 6, 0, 6, 0]\n , [ 6, 6, 6, 0, 6, 6, 6, 1, 0, 0, 0, 0, 6, 1, 0, 0]\n , [ 6,14, 0, 0, 0, 0, 6, 0, 0, 0, 0, 6, 0, 0, 0, 0]\n , [ 0, 0, 6, 0, 1, 0, 6, 0, 0, 6, 0, 0, 1, 0, 6, 6]\n , [ 0, 6, 6, 6, 6, 6, 0, 0, 6, 0, 6, 6, 6, 6, 6, 6]\n ]>>\n\n<<set $road =\n [ [14,14,14,18, 6, 6,18, 6,14, 6, 6,14, 6, 6, 6, 6]\n , [18, 6,14,14, 6, 6, 6, 6, 6,14, 6, 0,14, 6, 6, 6]\n , [ 6, 6, 1, 0, 6, 6, 6,14,14, 6, 6, 6, 6, 6,18, 6]\n , [ 0,14, 6, 6, 0, 0,14, 6, 0, 6, 0,14, 6, 0, 6, 0]\n , [ 0,18, 0, 0,14, 0, 0, 0, 6,14, 6, 0, 6, 6, 6, 6]\n , [ 0, 0, 6, 0, 0, 6, 6, 0, 0, 6, 0, 6, 0, 0, 0, 6]\n , [ 0, 6, 0, 0, 6, 0, 0, 0, 6, 6, 6, 0, 0, 6, 6, 0]\n , [ 0, 6, 0, 6, 0, 0, 6, 0, 0, 0, 6, 0, 6, 0, 0, 6]\n , [12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12]\n , [ 0, 0, 0, 6, 0, 6, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6]\n , [ 0, 6, 0, 0,18, 6, 0, 6, 6,14, 0, 0, 0, 6, 1, 0]\n , [ 6, 0, 6, 6, 1, 0, 6, 0, 6, 6, 6, 0, 6,14, 0, 6]\n , [ 6,18, 0, 0, 6,14, 0, 6, 0, 0, 6, 0, 0, 6,18,18]\n , [ 6, 6, 6,18, 6, 6,14, 6, 6,14, 6, 6,18, 6, 6, 6]\n , [ 6, 6, 0, 6, 6, 6, 6,14, 0, 6,18, 6, 6, 6, 6,18]\n , [ 6,18, 6, 6,18, 6, 6,18,18, 6, 6, 6, 6,18, 6, 6]\n ]>>\n\n<<set $forest =\n [ [ 0, 0, 6, 0, 1, 6, 6, 0, 6, 0, 0, 0,14, 6,18, 1]\n , [ 0, 6, 0, 6, 6, 6, 0,14, 6, 1, 0,14, 0,14, 1,18]\n , [ 0, 0, 0, 0, 6,14, 0, 6,18,14, 6, 6, 0, 6,14,14]\n , [ 6, 0, 1, 0, 0, 0,14, 6, 0, 6, 0,14, 0, 6,14, 6]\n , [ 6, 6, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,14]\n , [14, 6, 0, 0,14, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 6]\n , [ 6,14, 6, 0, 0, 0, 0, 0,14, 0, 0, 0, 0, 0, 6,14]\n , [ 6, 6, 0, 0, 0, 6,14, 6, 6,14, 0, 0, 0, 0,14, 6]\n , [ 0, 6, 6,14, 6, 6,18,14, 6, 0, 0, 0, 0, 0, 6,14]\n , [ 6, 6,14, 0,14, 6, 6, 6,14, 0, 6, 0, 0, 0, 6,18]\n , [ 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,14, 0, 6]\n , [14, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,14]\n , [ 6, 6, 0, 0, 0, 0,14, 0, 0,14, 0,14, 0, 0, 6,14]\n , [ 0,14, 0, 0, 0, 0, 0,14, 0, 6,14, 0,14, 6,14, 0]\n , [14, 6, 0, 0, 0,14,14, 0,14, 6, 6,18,14,14, 0, 6]\n , [ 6, 6, 0, 0, 6, 6, 6, 6, 6, 0, 0, 0, 6, 0, 6, 0]\n ]>>\n\n<<set $mountain =\n [ [22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22]\n , [22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22]\n , [22,22,22,22,22, 1, 1,22,22,22,22,22,22,22,22,22]\n , [22, 1,22,22,22,22,22,22,22,22,22,22,22, 1,22,22]\n , [22,22,22,22,22,22,22, 1,22,22,22,22,22,22,22,22]\n , [22,22,22,22, 1, 1,22,22,22, 0,22, 1,22,22,22,22]\n , [22, 1,22,22, 0,22,22,22,22,14, 0,22,22,22,22,22]\n , [22,22,22, 6, 0, 6, 6, 0, 0, 6, 0, 0, 0,22, 1,22]\n , [ 1,22,22, 0, 0, 0, 0, 0, 0, 0, 0,22, 0, 0,22,22]\n , [22,22,22, 0,14, 0, 0,22, 0, 0, 0,22,22, 0,22,22]\n , [22,22, 1, 0, 0, 0,22,22, 0, 0, 0, 1, 0, 0,22,22]\n , [22,22, 0, 0, 0, 6,22,22, 1, 0, 0, 0, 0, 0, 0,22]\n , [22, 1, 0, 0, 0, 0, 6,22, 0, 0, 0, 0, 1, 0, 0,22]\n , [22, 0, 0, 0, 0, 0, 0, 0, 0, 0,14, 0, 0, 6, 6,22]\n , [ 6, 0, 6,14, 0, 0, 0, 0, 0, 0, 6, 0, 6, 0, 6,22]\n , [ 6, 6, 0, 0, 0, 0, 6, 1, 6, 0, 6,14, 6,14,18, 6]\n ]>>\n\n<<set $caldera =\n [ [22,22, 1,22,22, 1,22, 1,22,22, 1,22, 1, 1,22,22]\n , [22,22, 1,22,22, 1,22, 1,22,22, 1,22, 1, 1,22,22]\n , [22,22, 1,22,22, 1,22, 1, 1,22, 1,22,22, 1,22,22]\n , [22,22, 1,22, 1, 1,22, 1, 1,22, 1,22,22, 1,22,22]\n , [22, 1, 1,22, 1, 1,22, 1, 1, 1, 1, 1,22, 1, 1,22]\n , [22, 1, 1,22, 1, 1, 1, 1, 1, 1, 1, 1,22, 1, 1,22]\n , [22, 1, 1, 1, 1, 1,22,22,22,22, 1, 1,22, 1, 1,22]\n , [ 1, 1, 1, 1, 1,22,22,22,22,22,22, 1, 1, 1, 1,22]\n , [ 1, 1, 1,22, 1,22,12,12,12,12,22, 1,22, 1, 1, 1]\n , [ 1, 1,22,22,22,12,12,12,12,12,12,22,22,22, 1, 1]\n , [ 1, 1,12,12,12,12,26,26,26,26,12,12,12, 1, 1, 1]\n , [27, 1,27,12,26,26,26,26,26,26,26,26,12,27, 1,27]\n , [27,27,27,26,26,26,26,26,26,26,26,26,26,27,27,27]\n , [22,27,27,27,27,26,26,26,26,26,26,27,27,27,27,22]\n , [ 1,22,27,27,27,27,27,27,27,27,27,27,27,27,22, 1]\n , [ 1, 1,22,22,27,27,27,27,27,27,27,27,22,22, 1, 1]\n ]>>\n\n<<set $fields =\n [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n ]>>\n\n<<set $river =\n [ [ 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6]\n , [ 6, 0, 0, 0, 0, 6, 0, 0, 0, 6, 0, 0,14, 0, 0, 0]\n , [ 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 6, 0, 0, 0,21,21]\n , [ 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,21,21,21]\n , [ 0,14, 0, 0, 1, 0, 0, 0, 0, 6, 0, 1, 0,21,21,23]\n , [ 0, 0, 0, 0,21,21, 0, 6, 0, 0, 0, 0,21,21,21, 6]\n , [ 0, 0,23,21,21,21, 0, 0,14, 0, 0,23,21,21, 1, 6]\n , [ 0, 0,21,21,21,21,21, 0, 0, 0, 6,23,21,21,14, 6]\n , [ 0, 1,21,21, 6,21,21, 0, 0, 0,23,21,21, 6, 6,18]\n , [ 0,21,21,21, 1,12,21,21, 1,23,23,21,21, 6, 6, 6]\n , [ 0,21,21, 6, 6, 6,21,21,21,21,21,21, 6, 6, 0, 6]\n , [21,21,21, 6,14,18, 1,21,21,21,21, 6,14, 6, 6,14]\n , [21,21, 6, 0, 6, 6, 6, 6,21,21, 6, 6, 6, 6,18, 6]\n , [ 6, 6, 6,18, 6, 0, 6, 6, 6, 6,14, 6, 0, 6, 6, 6]\n , [ 6,14, 6, 6,14, 6, 6,18, 6,14, 6,14, 6, 6, 6, 6]\n ]>>\n\n<<set $lake =\n [ [22,22,22, 0, 0,22,22,22,22,22,22,22,22,22,22,22]\n , [22,22,22,22, 0,22,22,22,22,22,22, 1, 1,21,21,21]\n , [22,22, 1,23,23, 1,22,22,21,21, 1,23,21,21,21,21]\n , [ 1,22,23,21,21,21, 1,21,21,21,21,23,21,21,21,21]\n , [ 0, 1,23,21,21,21,21,21,21,21,21,23,21,21, 6,21]\n , [ 6,14,23,21,21,21,21,21,21,21,21,23,21,21, 1,21]\n , [18, 0,23,23,21,21,21, 1,21,21,21,21,21,21,21,21]\n , [ 6,23,21,21,21,21,18, 6,21,21,21,21,21, 6,18,21]\n , [ 6,21,21,21,21,21,21,21,21,21,21,21,21,21, 6,21]\n , [21,21,21,21,21,21,21,21,21,14,21,21,21,21,21,21]\n , [21,21,23,23,21,21,21,21,21, 0,21,21,21,21,21,21]\n , [21,21, 0,23,21,21,21,21,21, 6, 6,21,21,21,21,21]\n , [ 6, 0, 0,21,21,21,21,21,21, 0, 6, 0, 0,14,21,21]\n , [18, 6, 6,21,21,21,21,21,14, 6, 0,21,21,21,21,21]\n , [ 6,14, 6, 0,21,21,21,23,23, 0,21,21,21,21,21,21]\n , [ 6, 6, 0, 6, 0, 0, 6,14, 6, 0,21,21,21,21,21,21]\n ]>>\n\n<<set $swamp =\n [ [21,24,24,21,23, 6,21,21,24,24,24,21,21,21,23, 6]\n , [24,14,24,21,21,23,21,14,24,24,24,21,21,21,24,21]\n , [24,24,21,21,21,23,21,21,21,24,21,24,24,21,14,24]\n , [21,21,23,23,21,21,21,21,21,21,21,14,24,21,24,24]\n , [23,23, 6,23,21,21,14,21,24,24,24,21,21,21,21,21]\n , [21,21,21,14,21,21,21,21,24,24,24,21,21,21,21, 6]\n , [21,24,24,21,21,14,21,24,24,23,21,21,21,21,14, 6]\n , [24,21,24,21,21,21,24,24,24, 6,23,24,14,21,23, 6]\n , [21,21,21,21,24,21,21,24,24,23,23,24,24,21,21,21]\n , [23, 6, 6,23,23,14,24,24,24,24,21,21,21,21,21,21]\n , [21,23,23,14,21,21,24,21,21,21,21,21,14,23, 6, 6]\n , [21,21,21,21,21,21,21,14,21,24,21,24,21,21,21, 6]\n , [21,21,24,24,21,21,21,23,21,24,14,24,24,24,21,21]\n , [24,24,14,24,24,21,23, 6,21,24,24,21,21,21,21,21]\n , [21,21,24,24,14,24,14, 6,21,21,21,21,21,23, 6,21]\n , [24,21,21,24,24,21, 6, 6,21,21,21,21,23, 6, 6, 6]\n ]>>\n\n<<set $ocean =\n [ [24,24,22,22,22,22,22,22,22,22,22,22,22,22, 0, 0]\n , [25,24,24,23,22,22,22,23,23,23,23,23,23, 6,22,22]\n , [25,24,24,24,23,22,22,23,21,21,21,23,23,23,23,22]\n , [25,25,25,24,21,23,23,21,24,24,24,24,21,23,23,22]\n , [25,25,25,25,24,21,21,24,24,24,24,24,24,21,23,23]\n , [25,25,24,25,24,21,24,24,24,25,25,24,24,24,21,23]\n , [13,25,25,25,24,24,25,24,25,24,24,25,24,24,21,23]\n , [13,13,25,25,25,24,25,24,24,24,25,24,24,24,21,21]\n , [13,13,25,24,25,24,24,25,25,24,25,24,21,21,21,21]\n , [13,13,13,13,25,24,25,24,24,24,24,24,21,21,21,21]\n , [13,13,13,13,25,25,13,24,24,25,24,21,24,24, 0,23]\n , [13,13,25,13,13,25,13,25,24,25,24,21,24,24,23,23]\n , [25,13,13,13,13,25,13,25,24,24,24,21,21,24,23,23]\n , [13,13,13,13,13,13,13,25,25,24,24,24,21,24,22,23]\n , [13,13,13,25,13,13,13,25,13,24,25,24,24,24,22,22]\n , [13,13,13,13,13,13,13,25,24,24,25,24,24,22,22,22]\n ]>>\n\n\n<<set $village =\n [ [ 0, 0,14, 6, 0,18,12,18, 6, 0, 0, 6, 6, 0, 6, 0]\n , [ 0,10,10,10,10, 6, 0, 6,10,10,10,10,10,10,10, 0]\n , [14,10,97,11,10, 6,18, 6,10,11,98,10,11,99,10, 0]\n , [ 0,10,11,11,10,14,18, 6,10,11,10,10,11,10,10, 6]\n , [ 6,10,10,11,10, 6, 0, 1, 6,12, 0, 6,12, 6, 0, 0]\n , [ 6, 0, 6,12, 6, 6,12, 6,12,12,12,12,12,12,12, 0]\n , [ 6,12,12,12,12,12,12,12,12, 0, 6,14,18, 0,12, 6]\n , [ 0,12, 0, 6, 0,14, 0, 0, 0,18,10,10,10, 6,12, 6]\n , [ 0,12, 6,10,10,10,10,10,10, 6,10,96,10, 6,12,12]\n , [ 0,12, 6,10,11,10,11,11,10, 6,10,11,10, 6,12, 6]\n , [ 0,12, 6,10,11,10,10,11,10, 6, 6,12, 6, 6,12, 6]\n , [ 0,12, 0, 0,12, 0, 6,12, 6, 0, 1,12, 0, 0,12,14]\n , [ 0,12,12,12,12,12,12,12,12,12,12,12,12,12,12, 0]\n , [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,12, 6, 0, 0,14, 6]\n , [ 2, 2, 1, 3, 4, 0, 3, 2, 0,10,11,10, 0,14, 6, 1]\n , [ 2, 2, 0, 4, 5, 0, 2, 3, 0,10,10,10, 6, 0, 1, 6]\n ]>>\n\n<<set $lt2 = String.fromCharCode(60) + String.fromCharCode(60) >>\n<<set $gt2 = String.fromCharCode(62) + String.fromCharCode(62) >>\n\n<<set $forestnpc =\n [ [[0, 6], $lt2 + "class mob" + $gt2 + "[[**|dryad]]" + $lt2 + "endclass" + $gt2]\n , [[6], $lt2 + "class obj" + $gt2 + "[[@@|flower]]" + $lt2 + "endclass" + $gt2]\n ]>>\n<<set $mountainnpc =\n [ [[22], $lt2 + "class mob" + $gt2 + "[[**|golem]]" + $lt2 + "endclass" + $gt2]\n , [[95], $lt2 + "class cave" + $gt2 + "[[&&|fairy_cave]]" + $lt2 + "endclass" + $gt2]\n ]>>\n<<set $roadnpc =\n [ [[12], $lt2 + "class mob" + $gt2 + "[[**|goblin]]" + $lt2 + "endclass" + $gt2]\n ]>>\n<<set $rivernpc =\n [ [[21], $lt2 + "class mob" + $gt2 + "[[**|merfolk]]" + $lt2 + "endclass" + $gt2]\n ]>>\n<<set $villagenpc =\n [ [[99], $lt2 + "class villager" + $gt2 + "[[**|blacksmith]]" + $lt2 + "endclass" + $gt2]\n , [[98], $lt2 + "class villager" + $gt2 + "[[**|shopkeep]]" + $lt2 + "endclass" + $gt2]\n , [[97], $lt2 + "class villager" + $gt2 + "[[**|elder]]" + $lt2 + "endclass" + $gt2]\n , [[96], $lt2 + "class villager" + $gt2 + "[[**|--]]" + $lt2 + "endclass" + $gt2]\n ]>>\n<<set $lakenpc =\n [ [[21], $lt2 + "class mob" + $gt2 + "[[**|hydra]]" + $lt2 + "endclass" + $gt2]\n ]>>\n<<set $nonpc = []>>\n\n<<set $dirmap =\n [[" ", " ", " es ", " w", " "]\n ,[" ", " ", "n s ", " ", " "]\n ,[" e ", " e w", "nesw", " w", " "]\n ,[" e ", " e w", "ne w", " w", " "]\n ]>>\n/%\n<<set $dirmap =\n [[" es ", " esw", " esw", " sw", " "]\n ,["nes ", "nesw", "nesw", "n sw", " "]\n ,["nes ", "nesw", "nesw", "n sw", " "]\n ,["ne ", "ne w", "ne w", "n w", " "]\n ]>>\n%/\n$fulldirmap =\n [[" s ", " es ", " esw", " sw"]\n ,["n s ", "n ", "n s ", " n "]\n ,["ne ", " e w", "nesw", " w"]\n ,[" e ", " e w", "ne w", " w"]\n ]\n<<set $mapnames =\n [["the last citadel of the nightmare world","fairy spring","mountain", "caldera", "fairy cave"]\n ,["CLOCKTOWER","CRYSTAL FOREST","forest","demon town", "underground passage"]\n ,["village","road","home","FIELD", "crystal caverns"]\n ,["the shores of the black ocean","great swamp","river","lake", "the abyssal gate"]\n ]>>\n<<set $maps =\n [[ $e, $e, $mountain, $caldera, $e]\n ,[ $e, $e, $forest, $e, $e]\n ,[$village, $road, $home, $fields, $e]\n ,[ $ocean, $swamp, $river, $lake, $e]\n ]>>\n<<set $mapmutable =\n [[0, 0, 0, 0, 0]\n ,[0, 0, 0, 0, 0]\n ,[0, 0, 1, 1, 0]\n ,[0, 0, 0, 0, 0]\n ]>>\n<<set $npcs =\n [[$nonpc, $nonpc, $mountainnpc, $nonpc, $nonpc]\n ,[$nonpc, $nonpc, $forestnpc, $nonpc, $nonpc]\n ,[$villagenpc, $roadnpc, $nonpc, $nonpc, $nonpc]\n ,[$nonpc, $nonpc, $rivernpc, $lakenpc, $nonpc]\n ]>>\n\n<<set $times =\n [ "@@background-color: #c00;color:#fc0;dawn@@"\n , "early morning"\n , "morning"\n , "late morning"\n , "midday"\n , "early afternoon"\n , "afternoon"\n , "early evening"\n , "evening"\n , "late evening"\n , "@@background-color: #c00;color:#fc0;dusk@@"\n , "@@background-color:#334;color:#222;night@@"\n , "@@background-color:#334;color:#222;night@@"\n , "@@background-color:#334;color:#222;night@@"\n , "@@background-color:#334;color:#222;night@@"\n , "@@background-color:#334;color:#f90;the witching hour@@"\n , "@@background-color:#334;color:#222;night@@"\n , "@@background-color:#334;color:#222;night@@"\n , "@@background-color:#334;color:#222;early morning@@"\n , "@@background-color:#334;color:#222;early morning@@"\n ]>>\n\n<<set $invlabels =\n [ ["piece of wood", "pieces of wood"]\n , ["rock", "rocks"]\n , ["crop", "crops"]\n , ["white herb", "white herbs"]\n , ["green herb", "green herbs"]\n , ["black herb", "black herbs"]\n , ["berry", "berries"]\n , ["flower", "flowers"]\n ]>>\n<<set $wood = 0>>\n<<set $rock = 1>>\n<<set $crop = 2>>\n<<set $whiteHerb = 3>>\n<<set $greenHerb = 4>>\n<<set $blackHerb = 5>>\n<<set $berry = 6>>\n<<set $flower = 7>>\n\n<<set $day = 1>>\n<<set $time = 1>>\n<<set $sleep = false>>\n<<set $stamina = 8>>\n\n<<set $x = 2>>\n<<set $y = 2>>\n<<set $current = $home>>\n\n<<set $inv = [0, 0, 0, 0, 0, 0, 0, 0]>>\n\n\nvisitors:\n - dryad (forest)\n - golem (mountain)\n - villager (village)\n - wailing ghost (???)\n - nightmare centaur (nightmare citadel)\n - goblin (road)\n - merfolk (river)\n - sahagin (swamp)\n - spirit of flame (caldera)\n - jeering demon (demon ruins)\n - bat-monster (underground passage)\n - crystal lizard (crystal caves)\n - abyssal were-shark (ocean)\n - machine god (clocktower)\n - centaur (field)\n - hydra (lake)\n - fairy (mountain cave)\n\n<<set $merfolk = 0>>\n<<set $dryad = 1>>\n<<set $golem = 2>>\n<<set $goblin = 3>>\n<<set $hydra = 4>>\n<<set $npcaffection = [0, 0, 0, 0, 0]>>\n<<set $npctoday = [0, 0, 0, 0, 0]>>\n<<set $lake_unlocked = false>>\n<<set $fairy_cave_unlocked = false>>\n\n<<endsilently>>\n> --\n>\n> [[.|begin]][[.|begin]][[.|begin]][[.|begin]]\n>- [[.|begin]][[.|begin]][[.|begin]][[.|begin]] -\n>- [[.|begin]][[.|begin]][[.|begin]][[.|begin]] -\n> [[.|begin]][[.|begin]][[.|begin]][[.|begin]]\n>\n> --
<<display "map">>
<<set $x -= 1>><<display "advanceTime">><<set $current = $maps[$y][$x]>><<display "map">>
<<set $x += 1>><<display "advanceTime">><<set $current = $maps[$y][$x]>><<display "map">>
<<set $y -= 1>><<display "advanceTime">><<set $current = $maps[$y][$x]>><<display "map">>
<<set $y += 1>><<display "advanceTime">><<set $current = $maps[$y][$x]>><<display "map">>
<<drawmap>><<display "location">>\n\n<<display "information">>
<<silently>>\n<<if $time lt 6>>\n <<set $hoursSlept = 3>>\n <<set $sleptLine = "You nap for a while.">>\n<<else>>\n <<if $time lt 13>>\n <<set $hoursSlept = ((20 - $time) / 2)|0>>\n <<set $sleptLine = "You sleep until " + $times[$time + $hoursSlept] + ", then wake.">>\n <<else>>\n <<set $hoursSlept = 20 - $time>>\n <<set $sleptLine = "You sleep until " + $times[0] + ".">>\n <<endif>>\n<<endif>>\n<<set $advanceTime = $hoursSlept>>\n<<set $sleep = true>>\n<<display "advanceTimeRepeat">>\n<<set $sleep = false>>\n<<endsilently>><<drawmap>><<display "location">>\n\n<<print $sleptLine>>\n\n<<display "information">>
<<if $advanceTime gt 0>><<display "advanceTime">><<set $advanceTime = $advanceTime - 1>><<display "advanceTimeRepeat">><<endif>>
<<set $time = $time + 1>><<if $time == 16>><<display "growLocations">><<endif>><<if $sleep == true && $stamina lt 12>><<set $stamina = $stamina + 1>><<endif>><<if $time gte 20>><<set $time = $time - 20>><<set $day = $day + 1>><<endif>>
<<growfields>><<resetevents>>
Day: <<print $day>>, <<print $times [$time % $times.length]>>\nLocation: <<print $mapnames [$y][$x]>>.
<<if $time lt 6 and $stamina lte 0 and $x == 2 and $y == 2>>You can [[nap|sleep]].<html><br></html>\n<<else>><<if $stamina lte 0 and $x == 2 and $y == 2>>You're too tired to work. You should [[sleep]].<html><br></html>\n<<else>><<if $time gte 10 and $x == 2 and $y == 2>>You can [[sleep]].<html><br></html>\n<<endif>><<endif>><<endif>>\n<<if $mapmutable [$y][$x]>>You're using a <<print $tools [$tool][0]>>. Switch: [[hoe]], [[hammer]], [[axe]], [[seeds]], [[herb seeds]], [[scythe]].\nYou have <<print $stamina>>/12 stamina.\n<<actions>><<else>>You can't use your tools here.<<endif>>\n\nYou have:\n<<inventory>>
<<set $tool = 0>><<drawmap>><<display "location">>\n\nYou pick up your hoe.\n\n<<display "information">>
<<set $tool = 1>><<drawmap>><<display "location">>\n\nYou pick up your hammer.\n\n<<display "information">>
<<set $tool = 5>><<drawmap>><<display "location">>\n\nYou pick up your axe.\n\n<<display "information">>
<<set $tool = 2>><<drawmap>><<display "location">>\n\nYou pick up your bag of seeds.\n\n<<display "information">>
<<set $tool = 4>><<drawmap>><<display "location">>\n\nYou pick up your bag of herb seeds.\n\n<<display "information">>
<<set $tool = 3>><<drawmap>><<display "location">>\n\nYou pick up your scythe.\n\n<<display "information">>
<<set $tool = 6>><<drawmap>><<display "location">>\n\nYou prepare a wall scaffold.\n\n<<display "information">>
<<set $tool = 7>><<drawmap>><<display "location">>\n\nYou prepare floor tiles.\n\n<<display "information">>
<<silently>>\n<<set $line = "Nothing happened.">>\n<<if $stamina lte 0>>\n <<set $line = "You're too tired to do that. You should get a good night's [[sleep|sleep]], instead!">>\n<<else>>\n <<set $stamina = $stamina - 1>>\n <<display "advanceTime">>\n <<if $current [$ay][$ax] == 0 && $tool == 0>>\n <<set $line = "You plow the grassy field.">>\n <<set $current [$ay][$ax] = 2>>\n <<endif>>\n <<if $current [$ay][$ax] == 6 && $tool == 0>>\n <<set $line = "You clear the weed-choked field.">>\n <<set $current [$ay][$ax] = 0>>\n <<endif>>\n <<if $current [$ay][$ax] == 17 && $tool == 0>>\n <<set $line = "You re-plow the overgrown field.">>\n <<set $current [$ay][$ax] = 2>>\n <<endif>>\n <<if $current [$ay][$ax] == 1 && $tool == 1>>\n <<set $line = "You smash the rocks with your hammer.">>\n <<set $current [$ay][$ax] = 12>><<set $inv [$rock] += 1>>\n <<endif>>\n <<if $current [$ay][$ax] == 10 && $tool == 1>>\n <<set $line = "You destroy the wall with your hammer.">>\n <<set $current [$ay][$ax] = 12>>\n <<endif>>\n <<if $current [$ay][$ax] == 11 && $tool == 1>>\n <<set $line = "You destroy the floor with your hammer.">>\n <<set $current [$ay][$ax] = 12>>\n <<endif>>\n <<if $current [$ay][$ax] == 0 && $tool == 1>>\n <<set $line = "You stamp the grass down to bare dirt.">>\n <<set $current [$ay][$ax] = 12>>\n <<endif>>\n <<if $current [$ay][$ax] == 15 && $tool == 5>>\n <<set $line = "You chop up the trunk of the tree with your axe.">>\n <<set $current [$ay][$ax] = 12>><<set $inv [$wood] += 1>>\n <<endif>>\n <<if $current [$ay][$ax] == 14 && $tool == 5>>\n <<set $line = "You cut down the tree with your axe.">>\n <<set $current [$ay][$ax] = 15>><<set $inv [$wood] += 1>>\n <<endif>>\n <<if ($current [$ay][$ax] == 19 || $current [$ay][$ax] == 20) && $tool == 5>>\n <<set $line = "You cut down the sapling with your axe.">>\n <<set $current [$ay][$ax] = 0>>\n <<endif>>\n <<if $current [$ay][$ax] == 2 && $tool == 2>>\n <<set $line = "You sow crop seeds.">>\n <<set $current [$ay][$ax] = 3>>\n <<endif>>\n <<if $current [$ay][$ax] == 2 && $tool == 4>>\n <<set $line = "You plant some herbs.">>\n <<set $current [$ay][$ax] = 7>>\n <<endif>>\n <<if $current [$ay][$ax] == 5 && $tool == 3>>\n <<set $line = "You reap your crops.">>\n <<set $current [$ay][$ax] = 2>><<set $inv [$crop] += 1>>\n <<endif>>\n <<if $current [$ay][$ax] == 8 && $tool == 3>>\n <<set $line = "You reap white herbs.">>\n <<set $current [$ay][$ax] = 2>><<set $inv [$whiteHerb] += 1>>\n <<endif>>\n <<if $current [$ay][$ax] == 9 && $tool == 3>>\n <<set $line = "You reap green herbs.">>\n <<set $current [$ay][$ax] = 2>><<set $inv [$greenHerb] += 1>>\n <<endif>>\n <<if $current [$ay][$ax] == 16 && $tool == 3>>\n <<set $line = "You reap black herbs.">>\n <<set $current [$ay][$ax] = 2>><<set $inv [$blackHerb] += 1>>\n <<endif>>\n <<if $current [$ay][$ax] == 18 && $tool == 3>>\n <<set $line = "You pick berries.">>\n <<set $current [$ay][$ax] = 0>><<set $inv [$berry] += 1>>\n <<endif>>\n <<if $current [$ay][$ax] == 12 && $tool == 6>>\n <<set $line = "You erect a wall.">>\n <<set $current [$ay][$ax] = 10>><<set $inv [$wood] -= 1>><<set $inv [$rock] -= 1>>\n <<endif>>\n <<if $current [$ay][$ax] == 12 && $tool == 7>>\n <<set $line = "You tile a floor.">>\n <<set $current [$ay][$ax] = 11>><<set $inv [$wood] -= 1>><<set $inv [$rock] -= 1>>\n <<endif>>\n<<endif>>\n<<endsilently>><<drawmap>><<display "location">>\n\n<<print $line>>\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou talk to the blacksmith.\n\n"Wares, finest crafted, all just five silver," says the blacksmith.\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou talk to the shopkeep.\n\n"General store, all your goods and services, competitive prices," says the shopkeep.\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou talk to the village elder.\n\n"", says the village elder.\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou talk to the goblin.\n\n<<if $npcaffection [$goblin] gte 3 && !$fairy_cave_unlocked>>"Gotta meet the [[boss|fairy_cave_first]], gotta meet the boss," says the goblin.<<else>>"Gotta keep movin', gotta keep movin'," says the goblin.<<if !$npctoday [$goblin]>><<set $npctoday [$goblin] = 1>><<set $npcaffection [$goblin] += 1>><<endif>><<endif>>\n\n<<display "information">>
<<set $x = 2>><<set $y = 0>><<set $current = $maps[$y][$x]>><<set $mountain[6][6] = 95>><<set $fairy_cave_unlocked = true>><<display "advanceTime">><<drawmap>><<display "location">>\n\nThe goblin rolls away a boulder blocking a cave entrance.\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou talk to the dryad.\n\n"Listen to the sun and the rain," says the dryad.<<if !$npctoday [$dryad]>><<set $npctoday [$dryad] = 1>><<set $npcaffection [$dryad] += 1>><<endif>>\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou pluck a forest flower.<<set $inv [$flower] += 1>>\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou talk to the golem.\n\n"The rocks have deep wisdom," says the golem.<<if !$npctoday [$golem]>><<set $npctoday [$golem] = 1>><<set $npcaffection [$golem] += 1>><<endif>>\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou talk to the merfolk.\n\n<<if $merfolk gte 3 && !$lake_unlocked>>/%\n%/"Up, up, up, to the [[source|lake_first]]," says the merfolk.<<else>>/%\n%/"Sand and shore, silt and salt," says the merfolk.<<if !$npctoday [$merfolk]>><<set $npctoday [$merfolk] = 1>><<set $npcaffection [$merfolk] += 1>>/%\n%/<<endif>><<endif>>\n\n<<display "information">>
<<set $x = 3>><<set $y = 3>><<set $current = $maps[$y][$x]>><<set $dirmap[3][2] = "ne ">><<set $dirmap[3][3] = " w">><<set $lake_unlocked = true>><<display "advanceTime">><<drawmap>><<display "location">>\n\nThe merfolk takes you far upstream, to the river's source.\n\n<<display "information">>
<<display "advanceTime">><<drawmap>><<display "location">>\n\nYou talk to the hydra.\n\nThe hydra roars.<<if !$npctoday [$hydra]>><<set $npctoday [$hydra] = 1>><<set $npcaffection [$hydra] += 1>><<endif>>
<<set $x = 4>><<set $y = 0>><<set $current = $maps[$y][$x]>><<drawmap>><<display "location">>\n\n<<display "information">>
<<set $ax = 0>><<set $ay = 0>><<display "runAction">>
<<set $ax = 1>><<set $ay = 0>><<display "runAction">>
<<set $ax = 2>><<set $ay = 0>><<display "runAction">>
<<set $ax = 3>><<set $ay = 0>><<display "runAction">>
<<set $ax = 4>><<set $ay = 0>><<display "runAction">>
<<set $ax = 5>><<set $ay = 0>><<display "runAction">>
<<set $ax = 6>><<set $ay = 0>><<display "runAction">>
<<set $ax = 7>><<set $ay = 0>><<display "runAction">>
<<set $ax = 8>><<set $ay = 0>><<display "runAction">>
<<set $ax = 9>><<set $ay = 0>><<display "runAction">>
<<set $ax = 10>><<set $ay = 0>><<display "runAction">>
<<set $ax = 11>><<set $ay = 0>><<display "runAction">>
<<set $ax = 12>><<set $ay = 0>><<display "runAction">>
<<set $ax = 13>><<set $ay = 0>><<display "runAction">>
<<set $ax = 14>><<set $ay = 0>><<display "runAction">>
<<set $ax = 15>><<set $ay = 0>><<display "runAction">>
<<set $ax = 0>><<set $ay = 1>><<display "runAction">>
<<set $ax = 1>><<set $ay = 1>><<display "runAction">>
<<set $ax = 2>><<set $ay = 1>><<display "runAction">>
<<set $ax = 3>><<set $ay = 1>><<display "runAction">>
<<set $ax = 4>><<set $ay = 1>><<display "runAction">>
<<set $ax = 5>><<set $ay = 1>><<display "runAction">>
<<set $ax = 6>><<set $ay = 1>><<display "runAction">>
<<set $ax = 7>><<set $ay = 1>><<display "runAction">>
<<set $ax = 8>><<set $ay = 1>><<display "runAction">>
<<set $ax = 9>><<set $ay = 1>><<display "runAction">>
<<set $ax = 10>><<set $ay = 1>><<display "runAction">>
<<set $ax = 11>><<set $ay = 1>><<display "runAction">>
<<set $ax = 12>><<set $ay = 1>><<display "runAction">>
<<set $ax = 13>><<set $ay = 1>><<display "runAction">>
<<set $ax = 14>><<set $ay = 1>><<display "runAction">>
<<set $ax = 15>><<set $ay = 1>><<display "runAction">>
<<set $ax = 0>><<set $ay = 2>><<display "runAction">>
<<set $ax = 1>><<set $ay = 2>><<display "runAction">>
<<set $ax = 2>><<set $ay = 2>><<display "runAction">>
<<set $ax = 3>><<set $ay = 2>><<display "runAction">>
<<set $ax = 4>><<set $ay = 2>><<display "runAction">>
<<set $ax = 5>><<set $ay = 2>><<display "runAction">>
<<set $ax = 6>><<set $ay = 2>><<display "runAction">>
<<set $ax = 7>><<set $ay = 2>><<display "runAction">>
<<set $ax = 8>><<set $ay = 2>><<display "runAction">>
<<set $ax = 9>><<set $ay = 2>><<display "runAction">>
<<set $ax = 10>><<set $ay = 2>><<display "runAction">>
<<set $ax = 11>><<set $ay = 2>><<display "runAction">>
<<set $ax = 12>><<set $ay = 2>><<display "runAction">>
<<set $ax = 13>><<set $ay = 2>><<display "runAction">>
<<set $ax = 14>><<set $ay = 2>><<display "runAction">>
<<set $ax = 15>><<set $ay = 2>><<display "runAction">>
<<set $ax = 0>><<set $ay = 3>><<display "runAction">>
<<set $ax = 1>><<set $ay = 3>><<display "runAction">>
<<set $ax = 2>><<set $ay = 3>><<display "runAction">>
<<set $ax = 3>><<set $ay = 3>><<display "runAction">>
<<set $ax = 4>><<set $ay = 3>><<display "runAction">>
<<set $ax = 5>><<set $ay = 3>><<display "runAction">>
<<set $ax = 6>><<set $ay = 3>><<display "runAction">>
<<set $ax = 7>><<set $ay = 3>><<display "runAction">>
<<set $ax = 8>><<set $ay = 3>><<display "runAction">>
<<set $ax = 9>><<set $ay = 3>><<display "runAction">>
<<set $ax = 10>><<set $ay = 3>><<display "runAction">>
<<set $ax = 11>><<set $ay = 3>><<display "runAction">>
<<set $ax = 12>><<set $ay = 3>><<display "runAction">>
<<set $ax = 13>><<set $ay = 3>><<display "runAction">>
<<set $ax = 14>><<set $ay = 3>><<display "runAction">>
<<set $ax = 15>><<set $ay = 3>><<display "runAction">>
<<set $ax = 0>><<set $ay = 4>><<display "runAction">>
<<set $ax = 1>><<set $ay = 4>><<display "runAction">>
<<set $ax = 2>><<set $ay = 4>><<display "runAction">>
<<set $ax = 3>><<set $ay = 4>><<display "runAction">>
<<set $ax = 4>><<set $ay = 4>><<display "runAction">>
<<set $ax = 5>><<set $ay = 4>><<display "runAction">>
<<set $ax = 6>><<set $ay = 4>><<display "runAction">>
<<set $ax = 7>><<set $ay = 4>><<display "runAction">>
<<set $ax = 8>><<set $ay = 4>><<display "runAction">>
<<set $ax = 9>><<set $ay = 4>><<display "runAction">>
<<set $ax = 10>><<set $ay = 4>><<display "runAction">>
<<set $ax = 11>><<set $ay = 4>><<display "runAction">>
<<set $ax = 12>><<set $ay = 4>><<display "runAction">>
<<set $ax = 13>><<set $ay = 4>><<display "runAction">>
<<set $ax = 14>><<set $ay = 4>><<display "runAction">>
<<set $ax = 15>><<set $ay = 4>><<display "runAction">>
<<set $ax = 0>><<set $ay = 5>><<display "runAction">>
<<set $ax = 1>><<set $ay = 5>><<display "runAction">>
<<set $ax = 2>><<set $ay = 5>><<display "runAction">>
<<set $ax = 3>><<set $ay = 5>><<display "runAction">>
<<set $ax = 4>><<set $ay = 5>><<display "runAction">>
<<set $ax = 5>><<set $ay = 5>><<display "runAction">>
<<set $ax = 6>><<set $ay = 5>><<display "runAction">>
<<set $ax = 7>><<set $ay = 5>><<display "runAction">>
<<set $ax = 8>><<set $ay = 5>><<display "runAction">>
<<set $ax = 9>><<set $ay = 5>><<display "runAction">>
<<set $ax = 10>><<set $ay = 5>><<display "runAction">>
<<set $ax = 11>><<set $ay = 5>><<display "runAction">>
<<set $ax = 12>><<set $ay = 5>><<display "runAction">>
<<set $ax = 13>><<set $ay = 5>><<display "runAction">>
<<set $ax = 14>><<set $ay = 5>><<display "runAction">>
<<set $ax = 15>><<set $ay = 5>><<display "runAction">>
<<set $ax = 0>><<set $ay = 6>><<display "runAction">>
<<set $ax = 1>><<set $ay = 6>><<display "runAction">>
<<set $ax = 2>><<set $ay = 6>><<display "runAction">>
<<set $ax = 3>><<set $ay = 6>><<display "runAction">>
<<set $ax = 4>><<set $ay = 6>><<display "runAction">>
<<set $ax = 5>><<set $ay = 6>><<display "runAction">>
<<set $ax = 6>><<set $ay = 6>><<display "runAction">>
<<set $ax = 7>><<set $ay = 6>><<display "runAction">>
<<set $ax = 8>><<set $ay = 6>><<display "runAction">>
<<set $ax = 9>><<set $ay = 6>><<display "runAction">>
<<set $ax = 10>><<set $ay = 6>><<display "runAction">>
<<set $ax = 11>><<set $ay = 6>><<display "runAction">>
<<set $ax = 12>><<set $ay = 6>><<display "runAction">>
<<set $ax = 13>><<set $ay = 6>><<display "runAction">>
<<set $ax = 14>><<set $ay = 6>><<display "runAction">>
<<set $ax = 15>><<set $ay = 6>><<display "runAction">>
<<set $ax = 0>><<set $ay = 7>><<display "runAction">>
<<set $ax = 1>><<set $ay = 7>><<display "runAction">>
<<set $ax = 2>><<set $ay = 7>><<display "runAction">>
<<set $ax = 3>><<set $ay = 7>><<display "runAction">>
<<set $ax = 4>><<set $ay = 7>><<display "runAction">>
<<set $ax = 5>><<set $ay = 7>><<display "runAction">>
<<set $ax = 6>><<set $ay = 7>><<display "runAction">>
<<set $ax = 7>><<set $ay = 7>><<display "runAction">>
<<set $ax = 8>><<set $ay = 7>><<display "runAction">>
<<set $ax = 9>><<set $ay = 7>><<display "runAction">>
<<set $ax = 10>><<set $ay = 7>><<display "runAction">>
<<set $ax = 11>><<set $ay = 7>><<display "runAction">>
<<set $ax = 12>><<set $ay = 7>><<display "runAction">>
<<set $ax = 13>><<set $ay = 7>><<display "runAction">>
<<set $ax = 14>><<set $ay = 7>><<display "runAction">>
<<set $ax = 15>><<set $ay = 7>><<display "runAction">>
<<set $ax = 0>><<set $ay = 8>><<display "runAction">>
<<set $ax = 1>><<set $ay = 8>><<display "runAction">>
<<set $ax = 2>><<set $ay = 8>><<display "runAction">>
<<set $ax = 3>><<set $ay = 8>><<display "runAction">>
<<set $ax = 4>><<set $ay = 8>><<display "runAction">>
<<set $ax = 5>><<set $ay = 8>><<display "runAction">>
<<set $ax = 6>><<set $ay = 8>><<display "runAction">>
<<set $ax = 7>><<set $ay = 8>><<display "runAction">>
<<set $ax = 8>><<set $ay = 8>><<display "runAction">>
<<set $ax = 9>><<set $ay = 8>><<display "runAction">>
<<set $ax = 10>><<set $ay = 8>><<display "runAction">>
<<set $ax = 11>><<set $ay = 8>><<display "runAction">>
<<set $ax = 12>><<set $ay = 8>><<display "runAction">>
<<set $ax = 13>><<set $ay = 8>><<display "runAction">>
<<set $ax = 14>><<set $ay = 8>><<display "runAction">>
<<set $ax = 15>><<set $ay = 8>><<display "runAction">>
<<set $ax = 0>><<set $ay = 9>><<display "runAction">>
<<set $ax = 1>><<set $ay = 9>><<display "runAction">>
<<set $ax = 2>><<set $ay = 9>><<display "runAction">>
<<set $ax = 3>><<set $ay = 9>><<display "runAction">>
<<set $ax = 4>><<set $ay = 9>><<display "runAction">>
<<set $ax = 5>><<set $ay = 9>><<display "runAction">>
<<set $ax = 6>><<set $ay = 9>><<display "runAction">>
<<set $ax = 7>><<set $ay = 9>><<display "runAction">>
<<set $ax = 8>><<set $ay = 9>><<display "runAction">>
<<set $ax = 9>><<set $ay = 9>><<display "runAction">>
<<set $ax = 10>><<set $ay = 9>><<display "runAction">>
<<set $ax = 11>><<set $ay = 9>><<display "runAction">>
<<set $ax = 12>><<set $ay = 9>><<display "runAction">>
<<set $ax = 13>><<set $ay = 9>><<display "runAction">>
<<set $ax = 14>><<set $ay = 9>><<display "runAction">>
<<set $ax = 15>><<set $ay = 9>><<display "runAction">>
<<set $ax = 0>><<set $ay = 10>><<display "runAction">>
<<set $ax = 1>><<set $ay = 10>><<display "runAction">>
<<set $ax = 2>><<set $ay = 10>><<display "runAction">>
<<set $ax = 3>><<set $ay = 10>><<display "runAction">>
<<set $ax = 4>><<set $ay = 10>><<display "runAction">>
<<set $ax = 5>><<set $ay = 10>><<display "runAction">>
<<set $ax = 6>><<set $ay = 10>><<display "runAction">>
<<set $ax = 7>><<set $ay = 10>><<display "runAction">>
<<set $ax = 8>><<set $ay = 10>><<display "runAction">>
<<set $ax = 9>><<set $ay = 10>><<display "runAction">>
<<set $ax = 10>><<set $ay = 10>><<display "runAction">>
<<set $ax = 11>><<set $ay = 10>><<display "runAction">>
<<set $ax = 12>><<set $ay = 10>><<display "runAction">>
<<set $ax = 13>><<set $ay = 10>><<display "runAction">>
<<set $ax = 14>><<set $ay = 10>><<display "runAction">>
<<set $ax = 15>><<set $ay = 10>><<display "runAction">>
<<set $ax = 0>><<set $ay = 11>><<display "runAction">>
<<set $ax = 1>><<set $ay = 11>><<display "runAction">>
<<set $ax = 2>><<set $ay = 11>><<display "runAction">>
<<set $ax = 3>><<set $ay = 11>><<display "runAction">>
<<set $ax = 4>><<set $ay = 11>><<display "runAction">>
<<set $ax = 5>><<set $ay = 11>><<display "runAction">>
<<set $ax = 6>><<set $ay = 11>><<display "runAction">>
<<set $ax = 7>><<set $ay = 11>><<display "runAction">>
<<set $ax = 8>><<set $ay = 11>><<display "runAction">>
<<set $ax = 9>><<set $ay = 11>><<display "runAction">>
<<set $ax = 10>><<set $ay = 11>><<display "runAction">>
<<set $ax = 11>><<set $ay = 11>><<display "runAction">>
<<set $ax = 12>><<set $ay = 11>><<display "runAction">>
<<set $ax = 13>><<set $ay = 11>><<display "runAction">>
<<set $ax = 14>><<set $ay = 11>><<display "runAction">>
<<set $ax = 15>><<set $ay = 11>><<display "runAction">>
<<set $ax = 0>><<set $ay = 12>><<display "runAction">>
<<set $ax = 1>><<set $ay = 12>><<display "runAction">>
<<set $ax = 2>><<set $ay = 12>><<display "runAction">>
<<set $ax = 3>><<set $ay = 12>><<display "runAction">>
<<set $ax = 4>><<set $ay = 12>><<display "runAction">>
<<set $ax = 5>><<set $ay = 12>><<display "runAction">>
<<set $ax = 6>><<set $ay = 12>><<display "runAction">>
<<set $ax = 7>><<set $ay = 12>><<display "runAction">>
<<set $ax = 8>><<set $ay = 12>><<display "runAction">>
<<set $ax = 9>><<set $ay = 12>><<display "runAction">>
<<set $ax = 10>><<set $ay = 12>><<display "runAction">>
<<set $ax = 11>><<set $ay = 12>><<display "runAction">>
<<set $ax = 12>><<set $ay = 12>><<display "runAction">>
<<set $ax = 13>><<set $ay = 12>><<display "runAction">>
<<set $ax = 14>><<set $ay = 12>><<display "runAction">>
<<set $ax = 15>><<set $ay = 12>><<display "runAction">>
<<set $ax = 0>><<set $ay = 13>><<display "runAction">>
<<set $ax = 1>><<set $ay = 13>><<display "runAction">>
<<set $ax = 2>><<set $ay = 13>><<display "runAction">>
<<set $ax = 3>><<set $ay = 13>><<display "runAction">>
<<set $ax = 4>><<set $ay = 13>><<display "runAction">>
<<set $ax = 5>><<set $ay = 13>><<display "runAction">>
<<set $ax = 6>><<set $ay = 13>><<display "runAction">>
<<set $ax = 7>><<set $ay = 13>><<display "runAction">>
<<set $ax = 8>><<set $ay = 13>><<display "runAction">>
<<set $ax = 9>><<set $ay = 13>><<display "runAction">>
<<set $ax = 10>><<set $ay = 13>><<display "runAction">>
<<set $ax = 11>><<set $ay = 13>><<display "runAction">>
<<set $ax = 12>><<set $ay = 13>><<display "runAction">>
<<set $ax = 13>><<set $ay = 13>><<display "runAction">>
<<set $ax = 14>><<set $ay = 13>><<display "runAction">>
<<set $ax = 15>><<set $ay = 13>><<display "runAction">>
<<set $ax = 0>><<set $ay = 14>><<display "runAction">>
<<set $ax = 1>><<set $ay = 14>><<display "runAction">>
<<set $ax = 2>><<set $ay = 14>><<display "runAction">>
<<set $ax = 3>><<set $ay = 14>><<display "runAction">>
<<set $ax = 4>><<set $ay = 14>><<display "runAction">>
<<set $ax = 5>><<set $ay = 14>><<display "runAction">>
<<set $ax = 6>><<set $ay = 14>><<display "runAction">>
<<set $ax = 7>><<set $ay = 14>><<display "runAction">>
<<set $ax = 8>><<set $ay = 14>><<display "runAction">>
<<set $ax = 9>><<set $ay = 14>><<display "runAction">>
<<set $ax = 10>><<set $ay = 14>><<display "runAction">>
<<set $ax = 11>><<set $ay = 14>><<display "runAction">>
<<set $ax = 12>><<set $ay = 14>><<display "runAction">>
<<set $ax = 13>><<set $ay = 14>><<display "runAction">>
<<set $ax = 14>><<set $ay = 14>><<display "runAction">>
<<set $ax = 15>><<set $ay = 14>><<display "runAction">>
<<set $ax = 0>><<set $ay = 15>><<display "runAction">>
<<set $ax = 1>><<set $ay = 15>><<display "runAction">>
<<set $ax = 2>><<set $ay = 15>><<display "runAction">>
<<set $ax = 3>><<set $ay = 15>><<display "runAction">>
<<set $ax = 4>><<set $ay = 15>><<display "runAction">>
<<set $ax = 5>><<set $ay = 15>><<display "runAction">>
<<set $ax = 6>><<set $ay = 15>><<display "runAction">>
<<set $ax = 7>><<set $ay = 15>><<display "runAction">>
<<set $ax = 8>><<set $ay = 15>><<display "runAction">>
<<set $ax = 9>><<set $ay = 15>><<display "runAction">>
<<set $ax = 10>><<set $ay = 15>><<display "runAction">>
<<set $ax = 11>><<set $ay = 15>><<display "runAction">>
<<set $ax = 12>><<set $ay = 15>><<display "runAction">>
<<set $ax = 13>><<set $ay = 15>><<display "runAction">>
<<set $ax = 14>><<set $ay = 15>><<display "runAction">>
<<set $ax = 15>><<set $ay = 15>><<display "runAction">>
made in [[twine|http://www.auntiepixelante.com/twine/]]. twee source for interested parties @ [[]]\n\nthere are 16 overland areas and 4 underground areas.\n\n -- [[xax|http://eccentric-nucleus.tumblr.com/]]\n\n[[<--|map]]
body {\n background: #000;\n color: #eee;\n font-family: monospace;\n line-height: 1.4em;\n font-size: 100%;\n margin: 10px 0 0 10px;\n}\n#sidebar {\n display: none;\n}\n#passages {\n margin: 0;\n border: none;\n padding: 0;\n}\n.passage {\n font-size: inherit;\n line-height: inherit;\n}\n#map,blockquote {\n letter-spacing: .33em;\n white-space: pre-wrap;\n width: 38em;\n float: left;\n line-height: 1.2em;\n}\n#notes {\n position: fixed;\n bottom: 0;\n right: 0;\n width: 2em;\n height: 2em;\n line-height: 2em;\n}\n#notes a {\n text-align: center;\n font-size: 150%;\n color: #111;\n background: #000;\n}\n#notes a:hover {\n color: #000;\n background: #fff;\n}\nli {\n list-style-position: inside;\n}\nul li {\n list-style-type: square;\n}\nh1 {\n display: none;\n}\n.passage .mob a {\n background: #cf0;\n}\n.passage .mob a:hover {\n color: #cf0;\n background: #000;\n}\n.passage .villager a {\n background: #04f;\n}\n.passage .villager a:hover {\n color: #04f;\n background: #000;\n}\n.passage .obj a {\n background: #f01;\n}\n.passage .obj a:hover {\n color: #f01;\n background: #000;\n}\n.passage .cave a {\n background: #666;\n}\n.passage .cave a:hover {\n color: #666;\n background: #000;\n}\n.passage a {\n color: #000;\n background: #905;\n font-weight: normal;\n text-decoration: none;\n}\n.passage a:hover {\n color: #f09;\n background: #000;\n text-decoration: none;\n}
String.prototype.unDash = function()\n{\n var s = this.split("-");\n if(s.length > 1)\n for(var t=1; t < s.length; t++)\n s[t] = s[t].substr(0,1).toUpperCase() + s[t].substr(1);\n return s.join("");\n};\nversion.extensions.classMacro={major:1,minor:0,revision:0};\nmacros.class =\n { handler: function (place, macroName, params, parser)\n {\n var tag = "span";\n if (params[1]) {\n tag = params[1];\n if (Wikifier.parse(params[1]) != params[1]) {\n tag = eval (Wikifier.parse(params[1]));\n }\n }\n var classes = "";\n if (params[0]) {\n classes = params[0];\n if (Wikifier.parse(params[0]) != params[0]) {\n classes = eval (Wikifier.parse(params[0]));\n }\n }\n var srcOffset=parser.source.indexOf(">>",parser.matchStart)+2;\n var src=parser.source.slice(srcOffset);\n var endPos=-1;\n var endElem=-1;\n var nesting=1;\n for(var i=0;i<src.length;i++){\n if(src.substr(i,7)=="<<class"){\n nesting++;\n }\n if(src.substr(i,12)=="<<endclass>>"){\n nesting--;\n if(nesting==0){\n endElem = i+12;\n endPos = srcOffset+i+12;\n break;\n }\n }\n }\n if (endPos == -1) {\n throwError(place,"can't find matching endclass");\n } else {\n newElem = insertElement (null, tag, null, classes);\n place.appendChild (newElem);\n new Wikifier(newElem, src.substr(0,endElem));\n parser.nextMatch=endPos;\n }\n }\n }\nmacros.endclass = { handler: function () {}}\nfunction preAdorn (y) {\n var vs = state.history[0].variables;\n if (y == 7 || y == 8) {\n if (vs.x > 0 && vs.dirmap[vs.y][vs.x][3] != " ") {\n return "[[+|left]] "\n } else {\n return "- ";\n }\n } else {\n return " ";\n }\n}\nfunction postAdorn (y) {\n var vs = state.history[0].variables;\n if (y == 7 || y == 8) {\n if (vs.x < 3 && vs.dirmap[vs.y][vs.x][1] != " ") {\n return " [[+|right]]";\n } else {\n return " -";\n }\n } else {\n return " ";\n }\n}\nfunction tileStyle(x, y, k) {\n var vs = state.history[0].variables;\n if (vs.time == 0 || vs.time == 10) {\n var sr = ((y ^ x) + k) % vs.duskdawn.length;\n return vs.duskdawn[sr];\n } else if (vs.time >= 11) {\n var sr = ((y ^ x) + k) % vs.night.length;\n return vs.night[sr];\n } else {\n var li = vs.current[y][x];\n if (k == 1 && y != 15 && vs.current[y+1][x] == 14) {\n // tree below so draw it w/ leaf colors\n return vs.landstyles[14][0];\n }\n switch (li) {\n case 19: // sapling\n case 20: // grown sapling\n case 15: // tree trunk\n case 14: // tree (divided into trunk and canopy styles)\n return vs.landstyles[li][k];\n break;\n case 10: // wall (link together if there's another wall below)\n if (k == 0 || (y != 15 && vs.current[y+1][x] == 10)) {\n return vs.landstyles[li][0];\n }\n return vs.landstyles[li][1];\n break;\n default:\n var sr = (Math.random() * vs.landstyles[li].length)|0;\n return vs.landstyles[li][sr];\n }\n }\n}\nfunction printMapCell (x, y, k) {\n var vs = state.history[0].variables;\n var li = vs.current[y][x];\n var r = (Math.random() * vs.lands[li].length)|0;\n var open1 = "";\n var close1 = "";\n var open2 = "";\n var close2 = "";\n if (!vs.mapmutable[vs.y][vs.x] || vs.tools[vs.tool][1].indexOf (li) == -1) {\n style1 = tileStyle(x, y, k);\n if (style1 !== "") {\n open1 = "@@" + style1;\n close1 = "@@";\n }\n if (li == 10 && y != 15 && vs.current[y+1][x] == 10) {\n return open1 + "" + vs.lands[li][r][0] + "" + close1;\n } else {\n style2 = tileStyle(x, y, k);\n if (style2 !== "") {\n open2 = "@@" + style2;\n close2 = "@@";\n }\n return open1 + "" + vs.lands[li][r][k][0] + "" + close1 + "" + open2 + "" + vs.lands[li][r][k][1] + "" + close2;\n }\n } else {\n if (li == 10 && y != 15 && vs.current[y+1][x] == 10) {\n return "[[" + vs.lands[li][r][0][0] + "" + vs.lands[li][r][0][1] + "|x" + x + "y" + y + "]]";\n } else {\n return "[[" + vs.lands[li][r][k][0] + "" + vs.lands[li][r][k][1] + "|x" + x + "y" + y + "]]";\n }\n }\n}\nfunction tilesMatching (map, types) {\n var matches = [];\n for (x = 0; x<16; x++) {\n for (y = 0;y<16; y++) {\n if (types.indexOf (map[y][x]) != -1) {\n matches.push ([x,y]);\n }\n }\n }\n if (matches.length == 0)\n return [[-1,-1]];\n else\n return matches[(Math.random() * matches.length)|0];\n}\nmacros['drawmap'] =\n { handler: function (place, macroName, params, parser)\n {\n var vs = state.history[0].variables;\n var npcs = vs.npcs[vs.y][vs.x];\n var npcPlaces = [];\n for (i = 0; i < npcs.length; i++) {\n npcPlaces.push(tilesMatching (vs.current, npcs[i][0]));\n }\n console.log (npcPlaces);\n\n var o = "";\n if (vs.y > 0 && vs.dirmap[vs.y][vs.x][0] != " ") {\n o += " [[++|up]][[++|up]]";\n } else {\n o += " ----"\n }\n o += "<br><br>";\n\n for (var y = 0; y < 16; y++) {\n for (var k = 0; k < 2; k++) {\n o += preAdorn(y);\n for (var x = 0; x < 16; x++) {\n var hasNpc = false;\n for (i = 0; i < npcPlaces.length; i++) {\n if (npcPlaces[i][0] == x && npcPlaces[i][1] == y)\n {\n o += npcs[i][1];\n hasNpc = true;\n }\n }\n if (!hasNpc)\n o += printMapCell (x, y, k);\n }\n o += postAdorn(y);\n o += "<br>";\n }\n }\n o += "<br>";\n if (vs.y < 3 && vs.dirmap[vs.y][vs.x][2] != " ") {\n o += " [[++|down]][[++|down]]";\n } else {\n o += " ----"\n }\n o += "<br><br>";\n var notes = document.createElement ('div');\n notes.setAttribute ('id', 'notes');\n place.appendChild (notes);\n new Wikifier(notes, "[[?|notes]]");\n\n var within = document.createElement ('div');\n within.setAttribute ('id', 'map');\n place.appendChild (within);\n new Wikifier(within, o);\n }\n }\nfunction growCrops () {\n // todo: grow home _and_ field\n var vs = state.history[0].variables;\n for (mx = 0; mx < 4; mx++) {\n for (my = 0; my < 4; my++) {\n if (!vs.mapmutable[my][mx])\n continue;\n for (x = 0; x < 16; x++) {\n for (y = 0; y < 16; y++) {\n switch (vs.maps[my][mx][y][x]) {\n case 3: // freshly-planted crops to growing crops\n (vs.maps[my][mx])[y][x] = 4;\n break;\n case 4: // growing crops to grown crops\n (vs.maps[my][mx])[y][x] = 5;\n break;\n case 7: // freshly-planted herbs to white herbs\n (vs.maps[my][mx])[y][x] = 8;\n break;\n case 8: // white herbs to green herbs\n (vs.maps[my][mx])[y][x] = 9;\n break;\n case 9: // green herbs to black herbs\n (vs.maps[my][mx])[y][x] = 16;\n break;\n case 19: // sapling to grown sapling\n (vs.maps[my][mx])[y][x] = 20;\n break;\n case 20: // grown sapling to tree\n (vs.maps[my][mx])[y][x] = 14;\n break;\n default:\n break;\n }\n }\n }\n }\n }\n}\nfunction decay () {\n var vs = state.history[0].variables;\n\n for (mx = 0; mx < 4; mx++) {\n for (my = 0; my < 4; my++) {\n if (!vs.mapmutable[my][mx])\n continue;\n for (i = 0; i < 12; i++) {\n var x = (Math.random() * 16)|0;\n var y = (Math.random() * 16)|0;\n switch ((vs.maps[my][mx])[y][x]) {\n case 18: // bush -> tall grass or grass\n (vs.maps[my][mx])[y][x] = Math.random() > 0.5 ? 6 : 0;\n break;\n case 6: // tall grass -> bush or grass\n (vs.maps[my][mx])[y][x] = Math.random() > 0.5 ? 18 : 0;\n break;\n case 0: // grass -> tall grass\n (vs.maps[my][mx])[y][x] = 6;\n break;\n case 12: // dirt path -> grass\n (vs.maps[my][mx])[y][x] = 0;\n break;\n case 2: // tilled field -> decayed tilled field (grows into grass)\n (vs.maps[my][mx])[y][x] = 17;\n break;\n case 17: // decayed field to grass\n (vs.maps[my][mx])[y][x] = 0;\n break;\n default:\n break;\n }\n }\n }\n }\n}\nmacros['growfields'] =\n { handler: function (place, macroName, params, parser)\n {\n growCrops ();\n decay ();\n }\n }\nmacros['resetevents'] =\n { handler: function (place, macroName, params, parser)\n {\n var vs = state.history[0].variables;\n\n // reset npc daily affection check\n vs.npctoday = [0, 0, 0, 0];\n\n // set all map npc lists to their canonical versions (i guess i'm assuming interacting w/ some objects or npcs should remove themselves from the active list for the rest of the day?)\n // figure out the random visitor, if any\n }\n }\nmacros['actions'] =\n { handler: function (place, macroName, params, parser)\n {\n var vs = state.history[0].variables;\n var acttext = "";\n if (vs.inv[vs.wood] >= 1 && vs.inv[vs.rock] >= 1) {\n acttext += "You can build a [[wall]] or [[floor]] with your materials. (1x rock, 1x wood)" + String.fromCharCode(10);\n }\n if (acttext.length > 0) {\n acttext = String.fromCharCode(10) + String.fromCharCode(10) + acttext;\n new Wikifier(place, acttext);\n }\n }\n }\nmacros['inventory'] =\n { handler: function (place, macroName, params, parser)\n {\n var vs = state.history[0].variables;\n var invtext = "";\n for (i = 0; i < vs.inv.length; i++) {\n if (vs.inv[i] != 0) {\n invtext += "* " + vs.inv[i] + " " + (vs.inv[i] == 1 ? vs.invlabels[i][0] : vs.invlabels[i][1]) + String.fromCharCode(10); // the twine/tiddlywiki parser doesn't like \ literals which means you can't just say "\ n". thus:\n }\n }\n if (invtext == "") {\n invtext = "* Nothing";\n }\n new Wikifier(place, invtext);\n }\n }\nmacros['notes'] =\n { handler: function (place, macroName, params, parser)\n {\n var within = document.createElement ('div');\n within.setAttribute ('id', 'notes');\n place.appendChild (within);\n new Wikifier(within, "[[?|notes]]");\n }\n }