<<set $inventory to []>>
/* true shows the debug links (start page and under the card) */
<<set $debug to false>>
/* Currently in use */
<<set $lastAction to
"The road east starts at your feet."
>>
<<set $turn to 0>>
/* ------------------------- */
/* XP-table for level checks */
/* XP for each level: 25·(L−1)·(L+2), so a level-up comes every few fights at first and every handful later */
<<set setup.xpTable to [
NaN /* Level 0 */,
0 /* Level 1 */,
100 /* Level 2 */,
250 /* Level 3 */,
450 /* Level 4 */,
700 /* Level 5 */,
1000 /* Level 6 */,
1350 /* Level 7 */,
1750 /* Level 8 */,
2200 /* Level 9 */,
2700 /* Level 10 */,
3250 /* Level 11 */,
3850 /* Level 12 */,
4500 /* Level 13 */,
5200 /* Level 14 */,
5950 /* Level 15 */,
6750 /* Level 16 */,
7600 /* Level 17 */,
8500 /* Level 18 */,
9450 /* Level 19 */,
10450 /* Level 20 */
]>>
<<set $player to {
currency : 250 /* their parents' savings: 250 silver */
}>>
<<set $player1 to {
name : "Brother",
level : 1,
xp : 0,
thisLevelXP : 0,
nextLevelXP : 100,
hp : 100,
hpBase : 100, /* max HP without gear; hpMax = hpBase + gear (setup.loot.recalc) */
hpMax : 100,
mp : setup.BALANS.mp.start,
mpBase : setup.BALANS.mp.start,
mpMax : setup.BALANS.mp.start,
crit : 5,
defense : 0,
spell : 0,
thisDamage : 0,
totalDamage : 0,
skills : setup.newSkills(), /* weapon skills and spell schools: { lvl, xp }, grow with use */
spells : clone(setup.STARTING_SPELLS),
points : 0, /* level-ups not yet spent on Vigor / Spirit / Balance */
ward : 0,
gear : { weapon: setup.loot.make("stick", "common", 1), head: null, body: setup.loot.make("tunic", "common", 1), hands: null, feet: null, trinket: null }
}>>
<<set $player1.thisLevelXP to $player.xp - setup.xpTable[$player.level]>>
<<set $player1.nextLevelXP to setup.xpTable[$player.level +1] - setup.xpTable[$player.level]>>
<<set $player2 to {
name : "Sister",
level : 1,
xp : 0,
thisLevelXP : 0,
nextLevelXP : 100,
hp : 100,
hpBase : 100, /* max HP without gear; hpMax = hpBase + gear (setup.loot.recalc) */
hpMax : 100,
mp : setup.BALANS.mp.start,
mpBase : setup.BALANS.mp.start,
mpMax : setup.BALANS.mp.start,
crit : 5,
defense : 0,
spell : 0,
thisDamage : 0,
totalDamage : 0,
skills : setup.newSkills(), /* weapon skills and spell schools: { lvl, xp }, grow with use */
spells : clone(setup.STARTING_SPELLS),
points : 0, /* level-ups not yet spent on Vigor / Spirit / Balance */
ward : 0,
gear : { weapon: setup.loot.make("stick", "common", 1), head: null, body: setup.loot.make("tunic", "common", 1), hands: null, feet: null, trinket: null }
}>>
<<set $player2.thisLevelXP to $player.xp - setup.xpTable[$player.level]>>
<<set $player2.nextLevelXP to setup.xpTable[$player.level +1] - setup.xpTable[$player.level]>>
/* the journey: steps taken (setup.resaSteg), rumours already heard */
<<set $resa to 0>>
<<set $rykten to []>>
/* the kind of every place passed so far, in order (setup.valjPlats spaces them out) */
<<set $platser to []>>
/* the clock (hours since the start, day 1 at 08:00), where they last slept, how they reached the city */
<<set $timme to setup.START_TIMME>>
/* winter's end: snow falling, and snow on the ground */
<<set $vader to "sno">>
<<set $snoTacke to 16>>
/* where they last went hunting (once per place) */
<<set $jagatHar to -1>>
<<set $arstidNytt to "">>
<<set $vaderNytt to "">>
<<set $moln to 0>>
<<set $vaken to 0>>
<<set $tack to {}>>
<<set $svaltDagar to 0>>
<<set $dodsorsak to "">>
<<set $trottNytt to 0>>
<<set $sovitHar to -1>>
/* the shape of the road ahead in the backdrop (setup.vagNy) */
<<set $vagform to { a: 0.4, b: -3, kurs: 0, v: "plan" }>>
<<set $vesterhavn to "">>
/* food: rations carried, and whether they went without this morning */
<<set $proviant to 8>>
<<set $farsk to 0>>
<<set $atitDag to 0>>
/* the road's stories: events seen, kindness shown, what the siblings have said, the dragon seen overhead, a shrine robbed */
<<set $handelser to []>>
<<set $godhet to 0>>
<<set $samtal to []>>
<<set $drakSett to false>>
<<set $forbannad to 0>>
/* the journal: one entry per place passed */
<<set $logg to []>>
/* a stream beside the road: { kvar: places left, sida: which side }; then the road crosses it */
<<set $back to null>>
<<set $backKors to false>>
<<set $backMote to false>>
<<set $loggResa to -1>>
<<set $hungrig to false>>
<<set $senastePlats to {}>>
<<set $enemy to setup.mote.ny("skog")>>
<<set $enemyPresent to false>>
/* ----------- */
/* Loot-tables */<div id="kuliss" aria-hidden="true">
<div class="h h-dag"></div><div class="h h-gryning"></div><div class="h h-skymning"></div><div class="h h-natt"></div>
<div class="stjarnor"></div><div class="arm"><div class="solskiva"></div><div class="mane"></div></div><div class="sol"></div><div class="moln"><svg width="100%" height="100%" aria-hidden="true"><filter id="moln-f" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB"><feTurbulence id="moln-brus" type="fractalNoise" baseFrequency="0.0026 0.0085" numOctaves="5" seed="3" result="brus"/><feColorMatrix id="moln-tackt" in="brus" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 6 -3" result="tackt"/><feDiffuseLighting in="brus" surfaceScale="2.6" lighting-color="#ffffff" result="ljus"><feDistantLight id="moln-ljus" azimuth="270" elevation="48"/></feDiffuseLighting><feComponentTransfer in="ljus" result="ljus2"><feFuncR type="linear" slope="0.55" intercept="0.5"/><feFuncG type="linear" slope="0.55" intercept="0.5"/><feFuncB type="linear" slope="0.55" intercept="0.5"/></feComponentTransfer><feFlood id="moln-farg" flood-color="#ffffff" result="farg"/><feBlend in="ljus2" in2="farg" mode="multiply" result="tonat"/><feComposite in="tonat" in2="tackt" operator="in"/></filter><rect width="100%" height="100%" filter="url(#moln-f)"/></svg></div><div class="rokdrift"></div>
<div class="berg-bak"></div><div class="berg-fram"></div><div class="mark"></div><div class="dyning"></div><div class="ljung"></div>
<div class="vatten"></div><div class="kron"><div class="vag vag2"></div><div class="spar spar2"></div></div><div class="slutt"></div><div class="kam"></div><div class="back"></div><div class="vagkant"><div class="vag"></div></div><div class="spar"></div><div class="vad"></div><div class="batar"></div><div class="skog skog-1"></div><div class="skog skog-1b"></div><div class="byggen"></div><div class="tak"></div><div class="husdetalj"></div><div class="brandsken"><i></i></div><div class="glod"><i></i></div><div class="hog"></div><div class="husrok"><i></i></div><div class="brandrok"><i></i></div><div class="dis"></div>
<div class="skog skog-2"></div><div class="skog skog-glest"></div><div class="stenar"></div><div class="skog skog-3"></div><div class="skog skog-4"></div>
<div class="dimma"></div><div class="morker"></div><canvas class="nedbor"></canvas><div class="regn"><i class="r0"></i><i class="r1"></i><i class="r2"></i><i class="r3"></i><i class="r4"></i></div><div class="sno"><i class="s0"><b></b></i><i class="s1"><b></b></i><i class="s2"><b></b></i><i class="s3"><b></b></i><i class="s4"><b></b></i></div><div class="rok"></div><div class="eld"></div><div class="krog"></div>
</div>
<div class="wrapper">
<header class="header">
<div class="titel"><div class="emblem liten" aria-hidden="true"><i class="b"></i><i class="s"></i></div><h1>Together</h1><span class="tagline">A tale of two siblings</span></div>
<div id="pung" class="pung" title="Purse"></div>
<button class="utsikt-knapp" type="button" aria-label="Hide the interface" title="Look at the land" aria-pressed="false"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M1.5 12S5.5 5 12 5s10.5 7 10.5 7-4 7-10.5 7S1.5 12 1.5 12z"/><circle cx="12" cy="12" r="3.2"/></svg></button>
<nav id="headermenu" data-passage="Menu"></nav>
</header>
<div id="resa"></div>
<div id="hud"></div>
<article class="main">
<div id="passages"></div>
<div id="actionbar" data-passage="ActionBar"></div>
</article>
<footer id="footer" class="footer" data-passage="Footer"></footer>
</div>
<div class="vader-flyt" aria-live="polite"></div><button class="utsikt-knapp flyt" type="button" aria-label="Show the interface" title="Back to the journey" aria-pressed="true"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M1.5 12S5.5 5 12 5s10.5 7 10.5 7-4 7-10.5 7S1.5 12 1.5 12z"/><circle cx="12" cy="12" r="3.2"/></svg></button><div class="titelsida">
<div class="emblem" aria-hidden="true"><i class="b"></i><i class="s"></i></div>
<h1>Together</h1>
<p class="tagline">A tale of two siblings</p>
<div class="knappar en">
<<if setup.harSpar()>><<button "Continue the journey">><<run setup.fortsatt()>><</button>><</if>>
<<button `setup.harSpar() ? "Begin a new journey" : "Begin the journey"` "Start">><</button>>
</div>
</div><<if not tags().includes("title")>>
<button class="meny-knapp" type="button" aria-label="Menu" aria-expanded="false">☰</button>
<ul class="meny-lista">
<li><<link "Inventory">><<run setup.openInventory()>><</link>></li>
<li><<link `$player1.name + "'s spells"`>><<run setup.magi.open("player1")>><</link>></li>
<li><<link `$player2.name + "'s spells"`>><<run setup.magi.open("player2")>><</link>></li>
<li><<link "Journal">><<run setup.dagbok.open()>><</link>></li>
<li><<link "Save / Load">><<run setup.spar.open()>><</link>></li>
<li class="sep"><<link "Restart">><<popup "popRestart">><</link>></li>
<li class="textstorlek"><span>Text size</span><button type="button" data-text="-1" aria-label="Smaller text">A−</button><button type="button" data-text="1" aria-label="Larger text">A+</button></li>
</ul>
<</if>><<if setup.PLATS[passage()]>><h2 class="plats"><<= setup.PLATS[passage()]>></h2><</if>><<updateStats $player1>>
<<updateStats $player2>><<if not tags().includes("title")>>
<p class="senast" id="displayAction">$lastAction</p>
<div id="actionBar">
<<if $rewardBtn and $enemy.id is "dragon">>
<div class="knappar en"><<button "The end of the road">><<set $rewardBtn to false>><<goto "Slutet">><</button>></div>
<<elseif tags().includes("turnCombat") and not $enemyPresent>>
<div class="knappar en"><<button "Keep walking">><<keepWalking>><</button>></div>
<<elseif tags().includes("finale")>>
<div class="knappar en"><<button "Face the dragon">><<run setup.karma.fore()>><<set $enemy to setup.DRAKEN($vesterhavn is "sent")>><<set $enemyPresent to true>><<goto "fightEnemy">><</button>></div>
<<elseif $rewardBtn>>
<div class="knappar en">
<<button "Collect the spoils">>
<<lastAction "You searched the fallen enemy.">>
<<goto "fightRewards">>
<</button>>
</div>
<<elseif tags().includes("turnCombat") and $enemyPresent>>
<div class="strid-val">
<div class="sida bror"><b>$player1.name</b>
<<button "Attack">><<run setup.strid.attack("player1")>><</button>>
<<if tags().includes("spell")>>
<span class="sekundar"><<button "Spell">><<run setup.magi.open("player1")>><</button>></span>
<</if>>
</div>
<div class="sida syster"><b>$player2.name</b>
<<button "Attack">><<run setup.strid.attack("player2")>><</button>>
<<if tags().includes("spell")>>
<span class="sekundar"><<button "Spell">><<run setup.magi.open("player2")>><</button>></span>
<</if>>
</div>
</div>
<<elseif tags().includes("attack") and $enemyPresent>>
<div class="knappar mote-val">
<<button "Fight">>
<<lastAction "You stood your ground.">>
<<goto "fightEnemy">>
<</button>>
<<if $enemy.pay is 0>>
<<elseif setup.mote.kanBetala()>>
<span class="sekundar"><<button `setup.mote.payLabel()`>><<run setup.mote.betala()>><</button>></span>
<<else>>
<span class="sekundar"><button type="button" disabled><<= setup.mote.payLabel()>></button></span>
<</if>>
<span class="sekundar"><<button "Run">><<run setup.mote.fly()>><</button>></span>
<span class="sekundar"><<button "Magic">><<run setup.magi.open()>><</button>></span>
</div>
<<else>>
<div class="knappar">
<<if setup.jakt.kan()>>
<span class="sekundar"><<button `setup.jakt.knapp()`>><<run setup.jakt.forsok()>><</button>></span>
<</if>>
<<if setup.butik.har()>>
<<button `setup.butik.knapp()`>><<run setup.butik.open()>><</button>>
<</if>>
<<if tags().includes("inventory")>>
<<button "Inventory">>
<<lastAction "You browsed your inventory.">>
<<run setup.openInventory()>>
<</button>>
<</if>>
<<if tags().includes("move")>>
<<button "Keep walking">>
<<lastAction "You kept on walking.">>
<<keepWalking>>
<</button>>
<</if>>
<<if tags().includes("enter")>>
<<button "Go inside">>
<<lastAction "You went inside.">>
<<goto "locationTavernInside">>
<</button>>
<</if>>
<<if tags().includes("exit")>>
<<button "Leave">>
<<lastAction "You went outside.">>
<<goto "locationTavernOutside">>
<</button>>
<</if>>
<<if tags().includes("dice") and $gamblerSlut>>
<span class="sekundar"><button type="button" disabled>The gambler is broke</button></span>
<<elseif tags().includes("dice")>>
<<button "Sit down with the gambler">>
<<lastAction "You sat down at the gambler’s table.">>
<<run setup.tavern.bord()>>
<</button>>
<</if>>
<<if not tags().includes("rest") and not tags().includes("room") and tags().includes("move") and not $enemyPresent and $sovitHar isnot $resa and setup.trott.niva() gte 1>>
<span class="sekundar"><<button "Sleep by the road (8 hours)">><<run setup.trott.vagkant()>><</button>></span>
<</if>>
<<if setup.mat.kanRoka()>>
<span class="sekundar"><<button `"Smoke the fresh meat (1 hour)"`>><<run setup.mat.roka()>><</button>></span>
<</if>>
<<if tags().includes("rest") and $sovitHar isnot $resa>>
<<button "Sleep (8 hours)">><<set $sovitHar to $resa>><<run setup.sov(false)>><<run setPageElement("actionbar", "ActionBar")>><</button>>
<</if>>
<<if tags().includes("room")>>
<<button "Trade with the farm’s mistress">><<run setup.butik.krog()>><</button>>
<</if>>
<<if tags().includes("room") and $sovitHar isnot $resa>>
<<button "A place by the hearth (5 silver, 8 hours)">><<run setup.rum()>><</button>>
<</if>>
</div>
<</if>>
</div>
<</if>><<if tags().includes("title")>><span class="upphovsratt"><<= setup.copyright>></span><</if>>
<<if $debug>>
<div class="debug">[[fightEnemy]] · [[debugWeapon]] · [[debugArmor]]</div>
<</if>><poptop>Inventory</poptop>
<div class="forrad"></div><poptop><span class="titel-text">Spells</span></poptop>
<div class="trollbok"></div><poptop>Level up!</poptop>
<div class="nivaval"></div><<set _dod to setup.dodsText()>><poptop><<= _dod.titel>></poptop>
<p class="dods-rad"><<= _dod.rad>></p>
<<= setup.dodsStats()>><<set $dodsorsak to "">>
<div class="knappar en">
<<if setup.harSpar()>><<button "Back to the last safe place">><<run setup.popup.close()>><<run setup.fortsatt()>><</button>><</if>>
<span class="sekundar"><<button "Restart">><<run setup.nyResa()>><</button>></span>
</div><poptop>Restart?</poptop>
<p>Start the journey over from the beginning? Everything the siblings have found and learned will be lost.</p>
<div class="knappar"><span class="sekundar"><<button "Keep playing">><<run setup.popup.close()>><</button>></span><<button "Restart">><<run setup.nyResa()>><</button>></div><poptop>Teningr</poptop>
<div class="spelbord"></div><poptop>The gambler’s table</poptop>
<div class="bordval"></div><poptop>Kvern</poptop>
<div class="spelbord"></div><poptop>Hnefatafl</poptop>
<div class="spelbord"></div><poptop><span class="titel-text">Shop</span></poptop>
<div class="butik"></div><poptop>Journal</poptop>
<div class="dagbok"></div><poptop>Save / Load</poptop>
<div class="sparfonster"></div><poptop>Rest</poptop>
<div class="vilafonster"></div><poptop>The hunt</poptop>
<div class="jaktfonster"></div>/* <<steg "place">>: one thing per step, so the page stays short. Either someone comes for you, or at most one of:
an event, the weather turning, the stream, a sign of the dragon, the siblings talking, the season turning
(setup.stegExtra). A weather change waits for a step with room for it. */
<<widget "steg">><<if setup.laddad>><p id="mote" class="tom-mote"></p><<elseif setup.mote.roll(_args[0])>><p id="mote" class="mote"><<= $enemy.intro>></p><<else>><p id="mote" class="tom-mote"></p><<= setup.stegExtra(_args[0])>><</if>><</widget>>
<<widget "samtal">><<= setup.samtal()>><</widget>><<widget "lastAction">>
<<set $lastAction to _args[0]>>
<<script>>setPageElement("actionbar", "ActionBar");<</script>>
<</widget>>/* Opens a popup passage. The second argument is the sibling it is about (the spellbook's caster). */
<<widget 'popup'>>
<<set _player to _args[1]>>
<<set _caster to _args[1]>>
<<set _casterKey to _args[1] and _args[1].name is $player2.name ? "player2" : "player1">>
<<run setup.popup.content(_args[0])>>
<<run setup.popup.open()>>
<</widget>>/* ------------------------------------------------------------------- */
/* Moves the player ahead one passage and displays the decision. */
<<widget 'keepWalking'>>
<<run setup.say("You kept walking.")>>
<<run setup.vidare()>>
<</widget>>/* ------------------------------------------------------------------- */
/* Generates a random amount of Currency to add to the Player's */
/* Usage: <<addCurrency 10 100>> randomizes the Min and Max added */
<<widget 'addCurrency'>>
<<set _addCurrency to random(_args[0], _args[1])>>
<<set _addGold to 0>>
<<set _addSilver to _addCurrency>>
<<set $player.currency += _addCurrency>>
<<if _addGold gt 0 and _addSilver gt 0>>
?addGold and ?addSilver\
<<elseif _addGold gt 0>>
?addGold\
<<elseif _addSilver gt 0>>
?addSilver<</if>>\
<</widget>>
<<widget 'displayValue'>>
<<set _value to _args[0]>>
<<set _addGold to 0>>
<<set _addSilver to _value>>
<<if _addGold gt 0 and _addSilver gt 0>>
?addGold and ?addSilver\
<<elseif _addGold gt 0>>
?addGold\
<<elseif _addSilver gt 0>>
?addSilver<</if>>\
<</widget>>/* ----------------------------------------------------------------- */
/* Updates level, experience and the party panel for one sibling. Usage: <<updateStats $player1>> */
<<widget 'updateStats'>>
<<set _p = _args[0] || $player1>>
/* Check for level up. */
<<if _p.level < (setup.xpTable.length - 1) and _p.xp >= setup.xpTable[_p.level + 1]>>
/* Find the greatest level the sibling has earned (-2: past the table = max level). */
<<set _toLevel to setup.xpTable.findIndex(function (req) { return _p.xp < req; }) - 1>>
<<if _toLevel is -2>>
<<set _toLevel to setup.xpTable.length - 1>>
<</if>>
/* Assign the new level: each level is a point to spend on Vigor, Spirit or Balance (setup.niva). */
<<set _p.points to (_p.points || 0) + _toLevel - _p.level>>
<<set _p.level to _toLevel>>
<<run setup.popup.content("popLevelUp")>>
<<run setup.popup.open()>>
<<run setup.niva.render()>>
<</if>>
<<set _p.thisLevelXP to _p.xp - setup.xpTable[_p.level]>>
<<set _p.nextLevelXP to setup.xpTable[_p.level + 1] - setup.xpTable[_p.level]>>
<<run setup.renderHud()>>
<</widget>>/* DISPLAYS THE ENEMY'S NAME AND HEALTH BAR (the siblings' bars are drawn by setup.renderHud) */
<<widget "enemyHP">>
<div class="fiende">
<div class="fiende-namn"><<= $enemy.The>></div>
<div id="enemy-health" class="bar hp"><i class="fyll" @style="'width:' + Math.max(0, Math.min(100, Math.round(100 * $enemy.hp / $enemy.hpMax))) + '%'"></i><span class="bar-text"><b>HP</b><span id="enemyHP">$enemy.hp / $enemy.hpMax</span></span></div>
<div class="fiende-status"></div>
</div>
<</widget>><p>Arbugæ, the river bend at the head of the lake, burned at winter’s end, and their house with it. All $player1.name and $player2.name have left is a purse of their parents' savings, and an aunt, Hedda, in Sigtuna: the king’s town on the water far to the east, which still stands.</p>
<p>The land between is starving. Armies march across it, something worse flies over it, and two travellers with full packs look rich.</p>
<p>Snow is falling as they set out.</p>
<<if $debug>>
<div class="debug">Debug locations: [[locationCamp]] · [[locationTavernOutside]] · [[locationForest]] · [[locationVillage]] · [[locationBattlefield]] · [[locationFields]] · [[locationHeath]] · [[locationRiver]] · [[locationLake]] · [[locationHills]] · [[locationMarsh]]</div>
<</if>><p><<= setup.platsText("skog", [
"The road runs on through dark spruce. Wheel ruts, a broken cart, a single shoe in the mud. Nobody has cleared the fallen trees for a long time.",
"The forest presses close on both sides of the road. Somewhere among the trees, someone is cutting wood, and stops when you come near.",
"A milestone by the road has been chipped clean of its name. Beyond it the spruce grow so thick that it is dusk at noon.",
"The road climbs through the forest. Crows sit in rows along the branches, as if they were waiting for something."
])>></p>
<<steg "skog">><p><<= setup.platsText("falt", [
"Fields on both sides of the road, gone to seed. Nobody harvested here last year; the rye lies flat where the snow pressed it down.",
"Open farmland. A scarecrow still stands in the middle of a field, dressed in a warrior’s tunic. There are no crows near it.",
"Furrows run to the horizon, half ploughed. A plough stands where the work stopped, and the ox that pulled it is nowhere to be seen."
])>></p>
<<steg "falt">><p><<= setup.platsText("hed", [
"The trees give way to open heath, brown and grey under a low sky. The wind has nothing to stop it here.",
"Heather and stone as far as you can see. Far off, smoke rises from somewhere you cannot see, straight up into the windless air.",
"The road crosses a bare moor. Old cairns mark the way. Someone has added fresh stones to every one of them, as if for the dead."
])>></p>
<<steg "hed">><p><<= setup.platsText("alv", [
"The road ends at a river. The bridge has been burned down to its stone piers; the only way over is the ford beside it, waist-deep and cold.",
"A ford across a broad, slow river. On the far bank someone has built a barricade out of carts, and left it.",
"A wooden bridge, still standing, though half its planks are gone. The water underneath is brown with ash from somewhere upstream."
])>></p>
<<steg "alv">><p><<= setup.platsText("sjo", [
"The road follows the shore of a long grey lake. Boats lie pulled up on the stones, holed so that nobody can take them.",
{ t: "A lake, still as glass. The water is clean, and cold enough to make your teeth ache. You drink, and for a moment the war is somewhere else.", s: ['to', 'var'] },
{ t: "The road runs along a bay that reaches far inland, white and flat from shore to shore. Sledge tracks cross it, straight as a spear.", s: ['vinter'] },
{ t: "A frozen lake. You break the ice at the edge and drink. The water is so cold it hurts, and for a moment the war is somewhere else.", s: ['vinter'] },
"Along the lake shore the reeds have been burned in a long black stripe, right down to the waterline."
])>></p>
<<steg "sjo">><p><<= setup.platsText("hojd", [
"The road runs along the top of a long gravel ridge, dry above the wet land on both sides. Pines grow on its back; anyone could be waiting among them.",
"From the ridge you can see a long way east: bays, reed beds, the smoke of a farm or two. Somewhere beyond it all is Sigtuna.",
"The ridge narrows until there is room for the road and nothing else. The wind is cold up here, and there is nowhere to hide from it."
])>></p>
<<steg "hojd">><p><<= setup.platsText("myr", [
"The road becomes a causeway of logs across a marsh. Mist lies on the black water, and the logs move under your feet.",
"Marshland. The air smells of rot and peat smoke. Somewhere in the fog a bird calls, and nothing answers it.",
"The road sinks into a bog and comes out again further on. Between here and there, someone has marked the safe path with sticks. Not all of them, you hope, by mistake."
])>></p>
<<steg "myr">><p><<= setup.platsText("by", [
{ t: "Charred posts stand where the houses used to be. The ash is cold. Someone has written a name in charcoal on every doorpost still standing.", h: "by-kall" },
{ t: "A village, or what is left of one. A dog watches you from a doorway with no house around it. The well has been filled with stones.", h: "by-kall" },
{ t: "The village is not empty. Faces watch you from the ruins: thin, quiet, and very interested in your packs.", h: "by-rok" }
])>></p>
<<steg "by">><p><<= setup.platsText("lager", [
"You come across an abandoned camp. The fire is out, but the coals are still warm. Whoever was here left in a hurry, and left a war-band’s painted shield in the ashes.",
"A deserters' camp in a hollow off the road: a torn tent, a pot burned black, boot prints going every way at once."
])>></p>
<<steg "lager">><p><<= setup.platsText("slag", [
"Crows lift from a field of the dead as you pass. Two war-bands met here; neither of them won. Shields lie in the mud, and nobody has come for the bodies.",
"An old battlefield. Rusted pikes still stand in rows where a line held, and broke. Scavengers have stripped the dead of everything but their teeth.",
"Half a war-band lies along the ridge in a burned line, as if they all fell at the same moment, facing the same way. Facing up."
])>></p>
<<steg "slag">><p><<= setup.platsText("krog-ute", [
{ t: "A big farm by the road, its hall long and low under a thatched roof. There is smoke from the roof-hole, and refugees sleep against the wall outside. Travellers who can pay are taken in.", h: "hall" },
{ t: "A farm at the crossroads, its gate barred. The mistress looks you over through the gap, sees your packs, and lets you in. Silver buys a place by the fire here.", h: "hall" }
])>></p>
<<steg "krog-ute">><<if passage() isnot previous()>>
<<set $diceHost to either("man", "woman")>>
<<set $diceCash to random(50, 200)>>
<<set $gamblerSlut to false>>
<<set $sistaInsats to null>>
<</if>>
<p>The hall is long and smoky, with benches along both walls and a fire down the middle. It is crowded and quiet. Nobody here has paid for a meal in a long time; they sit close to the hearth and watch your packs.</p>
<p>A $diceHost sits alone at a table, rolling a die across the tabletop, over and over. <<= $diceHost is "man" ? "He" : "She">> beckons you over to play. Silver for the game is the only silver anyone here has seen in months.</p>
<<set _r to setup.rykte()>><<if _r>><p class="viska">Across the hearth, someone whispers: “_r”</p><<else>><<samtal>><</if>><p>Aros: the river mouth, where the Svartån comes down to the lake. A landing place, a market on the shore, farms on the slopes, and the great burial mounds of the old kings just east of it. Half the boats are gone, and the people who stayed watch the sky.</p>
<p>A fisher’s widow lets you sleep in her boathouse. For one night, nobody will come for you.</p><p>Enescopinge, the market place at the head of the bay. There is no market now: the stalls stand empty and the traders have gone east by boat. The ones who are left sleep in their boathouses with the doors barred.</p>
<p>An old trader takes you in, for news of the west. For one night you sleep behind a door that holds.</p><p>The sound at Ekolsund, where the lake narrows between two shores. A ferryman takes you over for nothing but news, and leaves you in his hut on the far side.</p>
<p>From here the land is Attundaland, Sigtuna’s land. One more stretch of road along the water.</p><<set $turn to 0>>
<<set $enemyPresent to true>>
<<set $player1.thisDamage to 0>>
<<set $player2.thisDamage to 0>>
<<set $player1.ward to 0>>
<<set $player2.ward to 0>>
<<set $player1.bless to 0>>
<<set $player2.bless to 0>>
<<set $enemy.hold to 0>>
<<set $enemy.frozen to false>>
<<set $enemy.stunned to false>>
<<run setup.strid.busy = false>>
<<enemyHP>>
<div id="output" class="stridslogg"></div>
<<run setup.strid.borjan()>><<set $rewardBtn to false>>
<<set $enemyPresent to false>>
<<set $turn to 0>>
<<if setup.laddad>>
<p>The fight is over. $player1.name and $player2.name have already gathered what they wanted.</p>
<<if $byteKvar and $byteKvar.length>><div class="fynd-block"><h4>Still lying here</h4><div class="fynd-lista"><<= setup.loot.showDrops($byteKvar)>></div></div><</if>>
<<else>>
<<set _addXP to Math.round($enemy.xp * random(85, 115) / 100 * ($enemy.flydde or $enemy.xpHalv ? 0.5 : 1))>>
<<if $enemy.flydde>><<set $enemy.xpHalv to true>><</if>>
/* The sibling that dealt more damage receives more experience */
<<if $player1.thisDamage > $player2.thisDamage>>
<<set _xp1 to Math.trunc(_addXP*0.75)>>
<<set _xp2 to Math.trunc(_addXP*0.25)>>
<<else>>
<<set _xp1 to Math.trunc(_addXP*0.25)>>
<<set _xp2 to Math.trunc(_addXP*0.75)>>
<</if>>
<<set $player1.xp += _xp1>>
<<set $player2.xp += _xp2>>
<p><<= $enemy.flydde ? $enemy.flyRad : $enemy.funnen ? $enemy.funnen : $enemy.end>><<if not $enemy.funnen>> $player1.name dealt ''$player1.thisDamage'' damage and $player2.name ''$player2.thisDamage''.<</if>></p>
<ul class="byte">
<li><span class="ikon">✦</span>''_addXP XP'' <span class="dim">($player1.name _xp1, $player2.name _xp2)</span></li>
<<if not $enemy.flydde>>
<<if $enemy.coin[1] gt 0>><li><<addCurrency $enemy.coin[0] $enemy.coin[1]>></li><</if>>
<<set _mat to setup.mat.byte($enemy)>><<if _mat>><li><span class="ikon"><<= setup.ikon(setup.IKON.limpa, 'limpa', 'Rations')>></span>_mat <<= _mat is 1 ? "ration" : "rations">> of flatbread and dried fish</li><</if>>
<</if>>
</ul>
<<if $enemy.flydde>>
<<= setup.blodspar.ruta()>>
<<else>>
<<set _drops to setup.loot.forFoe($enemy)>>
<<set $byteKvar to _drops>>
<<if _drops.length>>
<div class="fynd-block"><h4><<= _drops.length is 1 ? "Something was left behind" : "Things were left behind">></h4>
<div class="fynd-lista"><<= setup.loot.showDrops(_drops)>></div></div>
<<else>>
<p class="dim">No gear or valuables on them.</p>
<</if>>
<</if>>
<</if>><<if not $vesterhavn>><<set $vesterhavn to setup.drakeFramme() ? "sent" : "forst">><</if>>
<<if $vesterhavn is "forst">>
<p>The road comes round the last bay, and there it is: Sigtuna, the king’s town. One long street along the water, narrow plots running down to the jetties, smoke from a hundred roofs. It still stands.</p>
<p>King Olof’s men stop you at the edge of the town and ask your business. Aunt Hedda lives on one of the narrow plots by the shore. She knows you at once, before you have said a word, and holds you both for a long time without saying anything at all.</p>
<p>At dusk the horns start blowing along the street, and do not stop. Out of the west, low over the forests you crossed, comes the dragon. You run down to the jetties, with the king’s men and every townsman who can draw a bow.</p>
<<else>>
<p>You smell Sigtuna before you see it. The dragon got here first.</p>
<p>Half the town is burning. People run down the plots to the jetties and push off in anything that floats. Nobody stops you going in.</p>
<p>The end of the street where Aunt Hedda lives is still standing, for now. Above it the dragon circles back over the roofs, unhurried, looking for whatever still moves. It sees you.</p>
<</if>><<if $vesterhavn is "forst">>
<p>The dragon falls into the water off the jetties, and the bay boils around it, and then it is still. Along the shore, people who have not cheered for a year begin to cheer, and do not stop.</p>
<p>That night you sleep in Aunt Hedda's house, by her fire, in a town that held. $player1.name and $player2.name made it. Together.</p>
<<else>>
<p>The dragon falls among the ruins it made. When the smoke clears, people come out of cellars and wells and the boats off the jetties, one by one, to look at it.</p>
<p>Aunt Hedda is among them, alive, with a burned sleeve, and she knows you at once. There is a town to rebuild. $player1.name and $player2.name will help. Together.</p>
<</if>>
<div class="slut-rutor">
<div><b><<= setup.dag()>></b><span>days on the road</span></div>
<div><b>$player1.level</b><span>$player1.name's level</span></div>
<div><b>$player2.level</b><span>$player2.name's level</span></div>
<div><b><<= setup.calling($player1) or "–">></b><span>$player1.name's way</span></div>
<div><b><<= setup.calling($player2) or "–">></b><span>$player2.name's way</span></div>
<div><b><<= $vesterhavn is "forst" ? "Saved" : "Burned">></b><span>Sigtuna</span></div>
<div><b>$godhet</b><span>kindnesses on the road</span></div>
</div>
<div class="knappar en"><<button "Begin a new journey">><<run setup.nyResa()>><</button>></div><p>Ten random items, item level <<= setup.resaSteg()>>, into the pack:</p>
<<for _i to 0; _i lt 10; _i++>><<set _it to setup.loot.roll(setup.resaSteg(), 2)>><<run $inventory.push(_it)>><p><<= setup.loot.nameHtml(_it)>> <span class="dim"><<= setup.loot.typeLine(_it)>></span></p><</for>><p>One of every legendary item, into the pack:</p>
<<for _u range setup.loot.UNIQUES>><<set _it to setup.loot.roll(1, 1000, null)>><</for>>
<<run setup.loot.UNIQUES.forEach(function (u, i) { if ($inventory.length < setup.loot.PACK) { var it = setup.loot.roll(3, 1e6); $inventory.push(it); } })>>
<p>Pack: <<= $inventory.length>> / <<= setup.loot.PACK>></p>