<<run setup.render(variables().currentGrid);>>
<<done>><<run setup.updateCaption();>><</done>>Thanks to the following people and resources for making this project possible:
* greatsquare0 for the [[thy-weaver|https://github.com/greatsquare0/thy-weaver]] SugarCube template
* redblobgames for the [[hexagons guide|https://www.redblobgames.com/grids/hexagons/]]
* flauwekeul for the [[typescript hexagon implementation|https://github.com/flauwekeul/honeycomb]]
* [[svg.js|https://svgjs.dev/]] for helping me render all these hexagons
* delapouite and lorc from [[game-icons.net|https://game-icons.net/]] for their [[free|https://game-icons.net/faq.html]] svg icons
* David Bau for the [[seedrandom|https://www.npmjs.com/package/seedrandom]] library, allowing me to generate random grids in a deterministic way
* John Suder for the [[abstract-astar|https://github.com/JSuder-xx/abstract-astar]] library, which helps me find a path through all those Tiles
* Sjoerd Hekking for the [[Flash|https://github.com/SjoerdHekking/custom-macros-sugarcube2/tree/main/Notification]] macro
* Lisa for the initial alpha testing and feedback<<for _i, _achievement range setup.achievements>>
<<if _achievement.days == 1>>
<<print _i + 1>>: <<print _achievement.name>> has completed the game in 1 day!<br>
<<else>>
<<print _i + 1>>: <<print _achievement.name>> has completed the game in <<print _achievement.days>> days!<br>
<</if>>
<</for>><div id="grid-summary">
<div id="player-days-label">Days:</div><div id="player-days" ><span style="width: 0%" class="progress-bar-underlay"></span><div class="black-text-overlay">0</div></div>
<div id="player-gems-label">Gems:</div><div id="player-gems" ><span style="width: 0%" class="progress-bar-underlay"></span><div class="black-text-overlay">0/5</div></div>
<div id="player-energy-label">Energy</div><div id="player-energy" ><span style="width: 50%" class="progress-bar-underlay"></span><div class="black-text-overlay">100/200</div></div>
</div><<button "Hall Of Fame">><<run Dialog.create("Hall Of Fame").wikiPassage("Hall Of Fame").open()>><</button>><<button "Credits">><<run Dialog.create("Credits").wikiPassage("Credits").open()>><</button>>
<<done>><<run setup.updateCaption();>><</done>><<run State.prng.init()>>
<<set $gems to $gems ?? []>>
<<set $playerEnergy to 100>>
<<set $playerMaxEnergy to 200>>
<<set $days to 0>>
<<run setup.updateCaption();>>
<<set setup.achievements to recall('achievements', [{name: 'Unknown Player', days: 20}]).sort((a,b) => a.days - b.days)>><h1> Ashenvale </h1>
As you step into the village square, the first thing you notice is the towering statue at its center. The monument depicts a robed figure, arms raised in a gesture of benediction or warning, with five empty eye sockets staring out over the gathered crowd. Each hollow eye seems to beckon, as if pleading for something long lost.
The square is abuzz with activity. Merchants hawk their wares from colorful stalls, while children play amongst the bustling feet of villagers going about their daily routines. Yet, despite the lively atmosphere, there is an undercurrent of tension that permeates the air.
Suddenly, the crowd parts, and a figure emerges from the nearby Sanctuary of Luminos. Father Eldon, the head priest, approaches the statue with a solemn air. He pauses, his hand resting on the base of the monument, and begins to speak in a voice that carries across the square.
"People of Ashenvale," he intones, his words measured and grave. "A great evil has befallen our land. The ancient gems that once adorned the Eyes of the Vigilant have been stolen, and with their loss, our protection has waned."
He gestures to the empty sockets, his face etched with concern. "These gems were not mere trinkets, but powerful artifacts imbued with the essence of the land itself. Without them, our defenses are weakened, and the dark forces that lurk in the shadows are emboldened."
Father Eldon turns to face you, his gaze piercing and intense. "You, young one, have been chosen for a sacred task. You must journey to the lands surrounding our village and retrieve the lost gems. Only then can we hope to restore balance and protect our people from the growing darkness."
As he speaks, the crowd falls silent, their eyes fixed upon you. Some nod in approval, their faces etched with determination and faith. Others look on with concern, their brows furrowed with worry for the task ahead.
Father Eldon places a hand on your shoulder, his touch both comforting and charged with purpose. "Go now, with the blessings of the Sanctuary of Luminos. May the light guide your path and the strength of the land flow through you. The fate of Ashenvale rests in your hands."
As the weight of the task settles upon your shoulders, you feel the eyes of the village upon you. The journey ahead will be perilous, but the fate of the village and its people rests on your success.
<<set $currentGrid to "OverlandGrid">>
What is your name?<<textbox "$playerName" "Alex" "Grid" autofocus>>
[[Set out on your Adventure!|Grid]]<h1> End </h1>
Congratulations! You have reached one of the ends of the game.
There's more to explore! Would you like to restart the game?
<<link "Restart!">><<script>>UI.restart();<</script>><</link>><<if $gems.includes($currentGrid)>>
<<set _include_passage to $currentGrid + " Statue Visited">>
<<else>>
<<set _include_passage to $currentGrid + " Statue First Time">>
<<run $gems.push($currentGrid);setup.updateCaption();>>
<<set $playerMaxEnergy to $playerMaxEnergy + 100>>
<<set $playerEnergy to $playerEnergy + 100>>
<</if>>
<<include _include_passage>>
<br><br>
<<grid OverlandGrid "Return outside">><<button "Stay around" Grid>><<run Dialog.close()>><</button>>You return to the chamber with the statue, now missing its gem. The once-radiant figure appears dull and lifeless, its empty socket a gaping void. The chamber feels colder, the shadows deeper, as if the gem's presence had been the only thing holding back the darkness.As you explore the dungeon's winding corridors, you come across a small chamber with a weathered statue. The statue holds a large, glowing gem. You reach out, grasp the gem, and with a soft click, it comes free, pulsing with an otherworldly energy. You slip the gem into your pouch and continue on your quest, the chamber growing colder as you leave with the first of the lost treasures.You return to the chamber with the statue, now missing its gem. The once-radiant figure appears dull and lifeless, its empty socket a gaping void. The chamber feels colder, the shadows deeper, as if the gem's presence had been the only thing holding back the darkness.As you explore the dungeon's winding corridors, you come across a small chamber with a weathered statue. The statue holds a large, glowing gem. You reach out, grasp the gem, and with a soft click, it comes free, pulsing with an otherworldly energy. You slip the gem into your pouch and continue on your quest, the chamber growing colder as you leave with the first of the lost treasures.You return to the statue in the grove, now bereft of its gem. The stone figure seems to loom larger in the darkness, its empty socket a yawning void that beckons and unnerves. The shadows feel heavier, the air thick with a palpable sense of loss. A chill runs down your spine as you realize that the grove, once a place of ancient power and mystery, has been diminished by your actions, and the weight of what lies ahead grows heavier with each step.As you step into the shadowy grove, your eyes are drawn to the towering statue at its center. The ancient stone figure, once vibrant, now stands weathered and worn. In its outstretched hand, a gleaming gem catches your eye, pulsing with an otherworldly light. With a gentle touch, the gem comes free, its radiance fading as you secure it in your pouch. The grove seems to shudder, the darkness pressing in, as if mourning the loss of its guardian's power.As you ascend the ruined tower once more, the wind's mournful whispers fill your ears. At the top, the statue stands in silent vigil, its empty socket a void that seems to swallow the light. The tower feels colder, more lifeless, as if the gem had been the last flickering ember of a dying fire. A sense of unease settles over you, a reminder of the growing darkness you must confront and the sacrifices that lie ahead in your quest to restore the lost treasures.As you climb the crumbling stairs of the ruined tower, the wind howls around you, carrying whispers of forgotten secrets. At the top, you find a weathered statue, its once-grand features now worn and eroded. In its grasp, a brilliant gem pulses with an eerie light, casting long shadows across the tower's broken battlements. With a reverent touch, you pry the gem free, feeling the tower shudder beneath your feet as if in mourning. You secure the gem in your pouch and turn to descend, the weight of your actions heavy on your shoulders.You find the statue standing in silent vigil, its base a dark, empty socket that mirrors the void within the cavern. The water feels colder, the currents less inviting, as if the gem had been the heart that gave life to this hidden realm. A chill runs through you, a reminder of the growing darkness that must be confronted and the sacrifices that must be made to restore the lost treasures and bring light back to the land.In the heart of this aquatic maze, you discover a submerged statue, its features obscured by the swirling currents. As you draw closer, you notice a mesmerizing gem nestled in the statue's base, pulsing with an inner light that seems to beckon you forward. With a reach of your hand, you grasp the gem and lift it free, feeling the icy water and the weight of ancient secrets against your skin. As you secure the gem in your pouch, the waters grow still, and a sense of foreboding settles over the caverns.<h1>Ashenvale</h1>
<<set $gems to $gems ?? []>>
<<if $gems.length < 5>>
As you return to Ashenvale, weary from your trials, the familiar streets and buildings offer a welcome respite. You make your way to the Sanctuary of Luminos, your steps heavy with exhaustion and the weight of the challenges that still lie ahead.
Father Eldon greets you with a nod of acknowledgment, his eyes filled with both relief and concern. "You have done well, young one," he says, his voice soft and reassuring. "But your journey is far from over. The darkness grows stronger with each passing day, and the lost gems must be found if we are to restore balance to the land."
You nod in agreement, weariness etched into the lines of your face. "I know, Father," you reply, your voice heavy with determination. "But for now, I must rest and gather my strength. The trials ahead will test me in ways I cannot yet imagine, and I must be prepared."
Father Eldon places a hand on your shoulder, his touch gentle and comforting. "Of course, child. Take the time you need to heal and reflect. The Sanctuary's doors are always open to you, and its blessings will be with you on your journey."
As you settle into a quiet corner of the temple, you reflect on the challenges you have faced and those that still lie ahead. The weight of the gems you seek seems to grow heavier with each passing moment, but you know that you cannot falter. The fate of Ashenvale, and perhaps the entire world, rests on your shoulders.
With a heavy sigh, you lean back against the cool stone wall and close your eyes, letting the gentle murmur of the Sanctuary's prayers wash over you as you drift into a much-needed slumber. The path ahead is uncertain, but in this moment, rest is the only certainty you have.
Tomorrow, you will rise and face the darkness once more, armed with the blessings of the Sanctuary and the hope of a brighter future. But for now, in the flickering candlelight of the temple, you allow yourself a moment of peace and the chance to gather the strength you will need for the battles to come.
[[Set out on your Adventure!|Grid][$currentGrid to "OverlandGrid"]]
<<else>>
As you make your way back to Eldritch Village, the weight of the five gems in your pouch feels both a triumph and a burden. The journey has been long and arduous, filled with challenges that tested your strength, courage, and resolve. But now, as you approach the village gates, you feel a sense of pride and accomplishment wash over you.
The villagers gather around you, their eyes wide with wonder and admiration as they see the gems you have brought back. Father Eldon steps forward, his face beaming with joy and relief. "Welcome back, brave hero," he says, his voice filled with reverence. "Your deeds will be remembered for generations to come."
With great care, you hand the gems to Father Eldon, who in turn places them into the empty sockets of the statue in the village square. As the final gem clicks into place, a brilliant light emanates from the statue, bathing the square in a warm, golden glow. The villagers gasp in awe, their faces reflecting the hope and gratitude that fill their hearts.
Father Eldon turns to you, raising his hands in a gesture of blessing. "In the name of the light and in the name of the land, I proclaim you as the village's savior and protector," he declares, his voice ringing out across the square. "Your bravery and dedication have brought us back from the brink of darkness, and for this, we are forever in your debt."
The villagers cheer and clap, their voices rising in a chorus of celebration and thanksgiving. They lift you onto their shoulders, parading you through the streets as a hero and a savior. Flowers are strewn at your feet, and the air is filled with the scent of incense and the sound of joyous laughter.
In the days that follow, the village buzzes with activity as life returns to normal. The statue in the square becomes a symbol of hope and resilience, a reminder of the light that can be found even in the darkest of times. And you, the once-humble adventurer, are now a legend, a shining example of the courage and determination that can be found within every heart.
<<run setup.achievements.push({name: $playerName, days: $days}); memorize('achievements', setup.achievements)>>
<<link "Restart the Game!">><<script>>UI.restart();<</script>><</link>>
<</if>>You stand at the base of a mountain, the weight of the past heavy in the air. Before you lies the entrance to the Forsaken Mines, a gaping maw that beckons and threatens in equal measure. The stone archway is worn and cracked, ancient runes etched into the rock, their meanings lost to time. Rusted iron gates hang askew, clinking in the mountain breeze.
As you step closer, a sense of unease prickles at the back of your neck. The darkness within seems to swallow the light, and the silence is deafening, broken only by the distant drip of water echoing from the depths. You can almost feel the weight of centuries watching from the shadows, the remnants of the sorcerers' dark magic lingering like a foul odor.
The ground at your feet is littered with debris - chunks of rock, twisted scraps of metal, and shards of what might once have been precious gems. The remnants of the mines' former glory, now reduced to ruin and decay. As you pick your way through the rubble, your eyes adjust to the gloom, and you catch glimpses of the horrors that lie in wait. Bones litter the ground, some ancient and crumbling, others disturbingly fresh. You spot the glint of metal, and your heart sinks as you realize these are the remains of those who ventured into the mines before you, never to return.
But there is also a tantalizing hint of the wealth that might still lie hidden in the depths. A glint of gold catches your eye, half-buried in the rubble, and your mind races with the possibilities of what treasures might still remain. The temptation to explore, to claim your fortune, is strong. But so too is the fear of what nightmares lurk in the darkness.
You stand at a crossroads, the path behind you clear and safe, the path ahead fraught with danger and uncertainty. The choice is yours - to turn back to the safety of the Village, or to descend into the Forsaken Mines and risk everything for the chance at unimaginable riches.
<<grid CaveGrid "Enter the Mines" true>><<grid OverlandGrid "Stay back">>You approach the Weeping Falls, the mist-shrouded pool shimmering invitingly in the sunlight. As you draw closer, you can't shake the feeling of being watched. The trees seem to whisper ominously as a gust of wind carries the haunting sound of distant screams.
The air grows colder as you reach the water's edge. Leaning over, you cup your hand in the crystalline liquid, marveling at its clarity. Suddenly, you feel a strange sensation, as if the water is seeping into your skin, filling you with a dark, unfamiliar energy.
You recoil instinctively, dropping the water back into the pool. That's when you notice it - amidst the droplets on your hand, there are tears. Tears that glitter like diamonds but carry the weight of untold sorrow.
Your heart races as the full realization of what you've discovered dawns on you. This is no ordinary waterfall - it's a portal to the very essence of the corruption that plagues the land.
You look around nervously, wondering if anyone else has noticed the true nature of the Weeping Falls. The trees seem to loom larger now, their branches reaching out like grasping claws. You feel the eyes of the damned upon you, their silent screams begging for release.
You take a step back, your mind reeling with the implications of what you've found. The Weeping Falls is a reminder that even the most beautiful things can be tainted by darkness. It's a warning, a siren's call to those who would seek to harness its power.
<<grid WaterfallGrid "Dive into the Waters" true>><<grid OverlandGrid "Stay back">>You find yourself standing at the edge of the dark forest, the air heavy with an unsettling stillness. As you cautiously step forward, the trees seem to close in around you, their gnarled branches reaching out like twisted fingers. The deeper you go, the more the light fades, until you find yourself in the suffocating darkness of the forest's heart.
Suddenly, you hear a low, pulsing whisper, barely audible at first but growing louder with each step. The whispers seem to come from all around you, an endless chorus of voices that speak in an ancient, unknown tongue. As you press on, you catch glimpses of flickering light through the trees, drawing you ever closer.
Emerging from the shadows, you find yourself standing before the Whisperer's Grove. The ancient tree looms before you, its trunk pulsing with an eerie, green light. The surrounding stone circle glows with an unnatural energy, the runes etched upon the weathered stones casting long, sinister shadows.
As you approach the grove, the whispers intensify, growing louder and more insistent. You can feel the weight of the grove's dark presence pressing down upon you, a palpable force that seems to draw you in, tempting you with the promise of forbidden knowledge.
<<grid GroveGrid "Step into the Grove" true>><<grid OverlandGrid "Stay back">>As your boat glides across the shimmering waters of the lake, the Isle of Echoes grows larger in the distance, its lush forests and rolling hills beckoning you forward. As you approach the shore, a sudden gust of wind whips across the water, carrying with it a strange, haunting sound - a chorus of whispers that seem to emanate from the very trees themselves.
Your boatman, a grizzled old sailor named Joren, looks back at you with a mixture of concern and fascination. "The Isle has a way of drawing people in," he says, his voice low and gravelly. "They come seeking answers, or power, or some dark secret that they hope to uncover. But the Isle has its own secrets, and it's not always kind to those who try to unravel them."
As you step onto the shore, you feel a sudden chill run down your spine. The air is cool and damp, heavy with the scent of moss and decay. The trees seem to loom over you, their branches twisting and gnarled, casting long shadows across the forest floor.
In the distance, you can see the ancient stone temple, its walls crumbling and covered in strange, glowing runes. The sight fills you with a mixture of awe and trepidation, and you feel a sudden urge to explore its depths.
But as you take a step forward, you hear a rustling in the underbrush behind you. You spin around, your hand reaching for the dagger at your side, and find yourself face to face with one of the island's strange, luminous creatures.
It stands before you, its skin pale and translucent, its eyes glowing like embers in the dark. It tilts its head, studying you with a curious, almost human-like expression, and then speaks in a voice that echoes through your mind rather than your ears.
"Welcome to the Isle of Echoes, child of the surface world," it says, its words filled with a strange, hypnotic power. "We have been waiting for you."
You feel a sudden wave of dizziness wash over you, and for a moment, the world seems to spin and blur around you. When your vision clears, you find yourself standing before the temple entrance, the creature nowhere to be seen.
The heavy stone doors creak open before you, revealing a dark, yawning abyss. A cold, musty breeze wafts out from the depths, carrying with it the scent of ancient, forgotten things
<<grid IslandGrid "Enter the Island" true>><<grid OverlandGrid "Stay back">>As you stand at the edge of the valley, the path stretching out before you leads to lands unknown. The weight of the choice bears down upon you - to leave Ashenvale behind and seek new adventures, or to stay and continue protecting the village that has become your home.
You glance back at the village nestled in the valley below, the Sanctuary of Luminos standing tall amidst the humble dwellings. The faces of the villagers flash through your mind - their smiles, their tears, their hopes, and their fears. They have come to rely on you, to see you as their guardian and protector.
With a heavy heart, you take a step back from the valley's edge. Ashenvale is your home now, and its people are your family. You cannot abandon them, not when they need you most.
<<grid OverlandGrid "Stay back">>As you stand before the imposing facade of the Sepulchral Sanctum, an overwhelming sense of awe and foreboding washes over you. The ancient stone temple rises from the earth like a slumbering behemoth, its weathered surface etched with countless strange runes and symbols that seem to writhe and dance in the ethereal light filtering through the dense forest canopy.
The entrance looms before you, a gaping maw framed by two massive stone guardians, their faces worn away by the relentless passage of time. Yet, even in their eroded state, they exude an unsettling aura of watchful malevolence. The air is heavy with the weight of centuries, thick with the cloying scent of damp earth and the tang of something ancient and long-forgotten.
As you approach the entrance, the hair on the back of your neck stands on end, and a sudden chill pierces your skin. The whispering that pervades the island intensifies here, the echoes of long-dead voices mingling with the rustle of leaves and the distant drip of water. The whispers seem to beckon you forward, promising secrets and knowledge, even as they warn of untold dangers lurking within the depths of the Sepulchral Sanctum.
<<grid SanctumGrid "Enter the Ruins" true>><<grid IslandGrid "Stay back">>You approach the hill where the Ruins of Wisdom's Spire lie, and as you crest the summit, the sight before you takes your breath away. The ruins stand like a ghostly sentinel, a crumbling remnant of a once-great tower that now looms over the desolate landscape.
The first thing you notice is the sheer size of the ruins. The tower must have been enormous in its heyday, with spires that reached towards the heavens. Now, only the skeletal remains of the structure stand, a maze of broken walls and shattered stone.
As you draw closer, you can't shake the feeling that something is watching you. The shadows seem to flicker and dance at the edges of your vision, and you swear you can hear whispers carried on the wind, speaking in a language you can't understand.
You pick your way through the rubble, marveling at the intricate carvings that adorn the few remaining intact walls. The symbols are alien and unsettling, unlike anything you've seen before. As you round a corner, you come face to face with a gaping hole in the tower's side, a yawning maw that seems to beckon you forward.
You step through the opening and into the ruins themselves. The air is heavy with the scent of decay and dust, and every step you take kicks up clouds of fine particles that dance in the shafts of light that filter through the broken roof.
<<grid TowerGrid1 "Enter the Tower" true>><<grid OverlandGrid "Stay back">>