Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
/* Map
Builds a map of the places you have visited and marks you have placed
But for now it's just a list ...
*/
<div class='center'>
<div class='monospace'>
<<for _y to 0; _y lt $map.length; _y++>>
<<for _x to 0; _x lt $map[_y].length; _x++>>
<<print $map[_y][_x]>> 
<</for>><br>
<</for>><br>
</div>
<div id='shift'>
<<for _i to 0; _i lt $mountainList.length; _i++>>
<span class='capitalize'>$mountainList[_i].name</span> –
<<print $world.x>>$mountainList[_i].x,
<<print $world.y>>$mountainList[_i].y –
$mountainList[_i].mark<br>
<</for>>
</div><br>
<<link 'All'>>
<<replace '#shift'>>
<<for _i to 0; _i lt $mountainList.length; _i++>>
<span class='capitalize'>$mountainList[_i].name</span> –
<<print $world.x>>$mountainList[_i].x,
<<print $world.y>>$mountainList[_i].y –
$mountainList[_i].mark<br>
<</for>>
<</replace>>
<</link>> 
<<link 'Filter (geo)'>>
<<replace '#shift'>>
<<for _i to 0; _i lt $mountainList.length; _i++>>
<<if $mountainList[_i].mark is 'geo'>>
<span class='capitalize'>$mountainList[_i].name</span> –
<<print $world.x>>$mountainList[_i].x,
<<print $world.y>>$mountainList[_i].y –
$mountainList[_i].mark<br>
<</if>>
<</for>>
<</replace>>
<</link>> 
<<link 'Filter (rotating)'>>
<<replace '#shift'>>
<<for _i to 0; _i lt $mountainList.length; _i++>>
<<if $mountainList[_i].mark is 'rotating'>>
<span class='capitalize'>$mountainList[_i].name</span> –
<<print $world.x>>$mountainList[_i].x,
<<print $world.y>>$mountainList[_i].y –
$mountainList[_i].mark<br>
<</if>>
<</for>>
<</replace>>
<</link>> 
<<link 'Filter (triangle)'>>
<<replace '#shift'>>
<<for _i to 0; _i lt $mountainList.length; _i++>>
<<if $mountainList[_i].mark is 'triangle'>>
<span class='capitalize'>$mountainList[_i].name</span> –
<<print $world.x>>$mountainList[_i].x,
<<print $world.y>>$mountainList[_i].y –
$mountainList[_i].mark<br>
<</if>>
<</for>>
<</replace>>
<</link>> 
<<link 'Record'>>
<<script>>Save.export('survey')<</script>>
<</link>> 
[[Go back|Travel]]
</div>/* Start
Runs every time a new session is started.
Session-specific variables are set here.
The opening screen of the game is described here.
*/
/* Initialise the world and region variables variable */
<<set $world to {}>>
<<set $world.x to random(100,999)>>
<<set $world.y to random(100,999)>>
<<set $region to {}>>
<<set $region.x to random(0,9)>>
<<set $region.y to random(0,9)>>
/* Initialise the map variable */
<<set $map to []>>
<<for _y to 0; _y lt 10; _y++>>
<<set _newRow to ['.','.','.','.','.','.','.','.','.','.']>>
<<set $map.push(_newRow)>>
<</for>>
/* Initialise the player variable */
<<set $player to $region>>
/* Initialise the list of mountains */
<<set $mountainList to []>>
/* Generate the first mountain you will visit */
<<generate_new_mountain>>
/* Set the time */
<<set $currentPeriod to 2>>
/* Generate a cloud at the western edge */
<<set $cloud to {}>>
<<set $cloud.xmin to 0>>
<<set $cloud.xmax to random(1,9)>>
<<set $cloud.ymin to random(0,4)>>
<<set $cloud.ymax to $cloud.ymin + random(1,5)>>
/* Display text. */
<div class="center">
Mountains and Monuments<br><br>
<div class='monospace'>
<<for _y to 0; _y lt $map.length; _y++>>
<<for _x to 0; _x lt $map[_y].length; _x++>>
<<print $map[_y][_x]>> 
<</for>><br>
<</for>><br>
</div>
[[Begin Survey|Travel]] 
<<link 'Resume Survey'>>
<<script>>
$(document.createElement('input'))
.css({
display : 'block',
visibility : 'hidden',
position : 'fixed',
left : '-9999px',
top : '-9999px',
width : '1px',
height : '1px'
})
.attr({
type : 'file',
id : 'saves-import-file',
tabindex : -1,
'aria-hidden' : true
})
.on('change', Save.import)
.trigger('click');
<</script>>
<</link>>
</div>/* Travel
Describes your travels across the mountains.
Mountain-specific temporary variables are set here. These are declared with the "_" character rather than the "$" character.
*/
/* Display the text. */
You are on Mount <span class='capitalize'>$currentMountain.name.</span>
<<print_current_weather>>
<span class='capitalize'><<print setup.vocab.period[$currentPeriod]>></span> sky.
The mountain is forested with $currentMountain.tree.
Wildflowers tinged $currentMountain.colour.<br><br>
<div class='center'>
<<link [[Move on|Travel]]>>
<<update_time>>
<<update_weather>>
<<update_player_position>>
<<generate_new_mountain>>
<</link>> 
<<link [[Place mark (geo)|Travel]]>>
<<set $currentMountain.mark to 'geo'>>
<<set $mountainList.push($currentMountain)>>
<<set $map[$player.y][$player.x] to 'o'>>
<<update_time>>
<<update_weather>>
<<update_player_position>>
<<generate_new_mountain>>
<</link>> 
<<link [[Place mark (rotating)|Travel]]>>
<<set $currentMountain.mark to 'rotating'>>
<<set $mountainList.push($currentMountain)>>
<<set $map[$player.y][$player.x] to 'x'>>
<<update_time>>
<<update_weather>>
<<update_player_position>>
<<generate_new_mountain>>
<</link>> 
<<link [[Place mark (triangle)|Travel]]>>
<<set $currentMountain.mark to 'triangle'>>
<<set $mountainList.push($currentMountain)>>
<<set $map[$player.y][$player.x] to 'v'>>
<<update_time>>
<<update_weather>>
<<update_player_position>>
<<generate_new_mountain>>
<</link>> 
[[Map]]
</div><br>/* WL_Beast
"Included" in relevant passages.
Lists of beasts that can inhabit the mountains are here.
Beast descriptions are "datamaps" which link together a species name, its body parts, and its "powers."
You can see how this could also be used for trees, plants, flowers, etc, e.g. in a type of "wort" with "five stems" that can make you "long-lived".
*/
/* Beast information. */
<<set $WL_Beast to [
{species: "cat",
body: ["heads", "eyes", "legs", "tails"],
power: ["agile", "silent", "long-lived"],
},
{species: "toad",
body: ["heads", "eyes", "legs"],
power: ["patient", "subtle"],
},
]>>/* WL_Terrain
"Included" in relevant passages.
Terrain and geographical wordlists are set here. */
/* Stone. */
<<set $WL_Stone to [
"limestone",
"granite",
]>>
/* Gems. */
<<set $WL_Gem to [
"jade",
"opal",
]>>/* Plural Widget */
<<widget "pl">>
<<if _parts gt 0>>
s
<</if>>
<</widget>>
/* Print current weather - OLD VERSION - the new version below checks if the player is within or outside a cloud zone */
/*
<<widget 'print_current_weather'>>
<<switch $currentWeather>>
<<case 0>>
Cloudless.
<<case 1>>
Rippling fields of cirrus.
<<case 2>>
Thin cirrus.
<<case 3>>
Cumulus overhead.
<<case 4>>
You smell moisture in the air. Clouds building up on the horizon.
<<case 5>>
The air is turning humid.
<<case 6>>
Light drizzle. You smell rich earth and vegetation.
<<case 7>>
Heavy rain and rolling thunder.
<<case 8>>
The air is cool.
<</switch>>
<</widget>>
*/
<<widget 'print_current_weather'>>
<<if $player.x gte $cloud.xmin and $player.x lte $cloud.xmax and $player.y gte $cloud.ymin and $player.y lte $cloud.ymax>>
You smell moisture in the air. It is cloudy overhead.
<<else>>
Cloudless.
<</if>>
<</widget>>
/* Generate new mountain */
<<widget 'generate_new_mountain'>>
/* Create a new mountain object */
<<set $currentMountain to {}>>
<<set $currentMountain.x to $player.x>>
<<set $currentMountain.y to $player.y>>
<<set $currentMountain.mark to ''>>
/* Generate the mountain */
<<set _name1 to either(setup.vocab.names)>>
<<set _name2 to either(setup.vocab.names)>>
<<set $currentMountain.name to String.format("{0}{1}", _name1, _name2)>>
<<set $currentMountain.tree to either(setup.vocab.trees)>>
<<set $currentMountain.colour to either(setup.vocab.colours)>>
<</widget>>
/* Update the time */
<<widget 'update_time'>>
<<set $currentPeriod++>>
<<if $currentPeriod gt 5>>
<<set $currentPeriod to 0>>
<</if>>
<</widget>>
/* Update the weather - progress the cloud eastwards, and once it leaves the screen generate a new cloud on the western edge*/
<<widget 'update_weather'>>
<<set $cloud.xmin++>>
<<set $cloud.xmax++>>
<<if $cloud.xmin gt 9>>
<<set $cloud.xmin to 0>>
<<set $cloud.xmax to random(1,9)>>
<<set $cloud.ymin to random(0,4)>>
<<set $cloud.ymax to $cloud.ymin + random(1,5)>>
<</if>>
<</widget>>
/* Update the player position */
<<widget 'update_player_position'>>
<<set $player.x to random(0,9)>>
<<set $player.y to random(0,9)>>
<</widget>>