(set: $name to "")(set: $hpcurr to 0)
<audio src="http://winonadanger.neocities.org/games/media/the_dungeon/dungeon_theme_v2.m4a" autoplay></audio><div align="center"><h3>the dungeon</h3><img src="http://winonadanger.neocities.org/games/media/the_dungeon/dungeon_cover_final.png">
[[credits]]
(link:"new game")[(set: (saved-games:) to (saved-games:) - (a:"game"))(go-to:"charsetup")]
{(if: (saved-games:) contains "game")[
(link: "load game")[(load-game:"game")]
]}</div>
{(if: $class is "ranger")[(set: $weapontype to "Bow")](elseif: $class is "barbarian")[(set: $weapontype to (either: "Axe","Mace"))](elseif: $class is "mage")[(set: $weapontype to "Staff")](elseif: $class is "cleric")[(set: $weapontype to "Staff")](elseif: $class is "rogue")[(set: $weapontype to "Dagger")(set: $legendaryweapname to "The " + (either: "Dreaded ","Holy ","Maiming ") + $weapontype + " of " + (either: "Awarnak", "Lailoken", "Lysanor","Dnias","Parsifal"))
(set: $legendaryarmorname to "The " + (either: "Dreaded ","Holy ","Immortal ") + $armorkind + " of " + (either: "Awarnak", "Lunete", "Parzifal","Lysanor","Drystan"))
(set: $hpcurr to $hpmax)
(set: $manacurr to $manamax)]}Greetings, $name, and welcome!
Your queen Vivien is in greatest need of your help. Her daughter $princessname has been kidnapped, and she has selected you as her hero!
(link-replace:"what's in it for me")[(set: $lawful to it - 1)(set: $good to it - 1)As you have recently fallen out of the queen's good favor, I highly recommend taking on this quest.
(link-replace: "still not sold on this")[(set: $lawful to it - 1)(set: $good to it - 1)She will also give you a large amount of gold.
]]
(link:"i will gladly serve her in her time of need")[(if: $lawful + $good is 0)[(set: $lawful to it + 1)(set: $good to it + 1)](go-to: "next")]
{
(set: $level to 1)(set: $weapon to "your fists")(set: $helmtype to "no helm")(set: $pantstype to "no greaves")(set: $shirttype to "no breastpiece")(set: $bootstype to "no boots")(set: $glovestype to "no gloves")
(if: $int is < 20)[(set: $xplevel to ($level*$level + 25))]
(else:)[(set: $xplevel to ($level*$level + 20))]
(set: $xpnext to ($xplevel - $xpcurr))
(set: $xpcurr to 0)
(if: $level*10 + $con < 20)[(set: $hpmax to 20)](else:)[(set: $hpmax to ($level*10 + $con))]
(if: $level*10 + $wis < 20)[(set: $manamax to 20)](else:)[(set: $manamax to ($level*10 + $wis))]
(set: $hpcurr to $hpmax)
(set: $manacurr to $manamax)
(set: $range to (a: -2, -1, 0, 1, 2))
(set: $lawful to 0)(set: $good to 0)(set: $lawfulmax to 5)(set: $goodmax to 5)(set: $lawfulmin to -5)(set: $goodmin to -5)
(set: $even to (a:2,3,4,6,7,8,10,11,12,14,15,16,18))
(set: $odd to (a: 5,9,13,17,19))
(set: $even2 to (a: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20))
(set: $odd2 to (a: 3, 5, 7, 9, 11, 13, 15, 17, 19))
(set: $pair to (a: "boots","greaves","gloves"))
(set: $princessname to "Galiene")
(set: $wizardname to "Trevrisent")
}
(set: $name to (prompt:"What is your name?"))
Choose a race:
|race>[(link-replace: "elf")[(set: $race to "elf")(replace: ?race)[$race]]
(link-replace: "orc")[(set: $race to "orc")(replace: ?race)[$race]]
(link-replace: "human")[(set: $race to "human")(replace: ?race)[$race]]
(link-replace: "dwarf")[(set: $race to "dwarf")(replace: ?race)[$race]]
(link-replace: "fairy")[(set: $race to "fairy")(replace: ?race)[$race]]
(link-replace: "randomize")[(set: $race to (either: "elf", "orc", "human", "dwarf", "fairy"))(replace: ?race)[$race]]]
Choose a class:
|class>[(link: "rogue")[(set: $class to "rogue")(replace: ?class)[$class]]
(link: "mage")[(set: $class to "mage")(replace: ?class)[$class]]
(link: "ranger")[(set: $class to "ranger")(replace: ?class)[$class]]
(link: "barbarian")[(set: $class to "barbarian")(replace: ?class)[$class]]
(link: "cleric")[(set: $class to "cleric")(replace: ?class)[$class]]
(link: "randomize")[(set: $class to (either: "rogue","mage","ranger","barbarian","cleric"))(replace: ?class)[$class]]]
(link: "continue")[(go-to: "charsheet rev")]
(set: $random to (either:"yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)](if: $location is "forest1")[To the north and west is forest too thick to go through, but there are paths to the east and south.](if: $location is "forest2")[To the north is forest too thick to venture through, but to the east, west, and south are paths.](if: $dungeon contains $location)[To the west and north are the stone walls of the dungeon.]
(if: $turn is 10)[(set: $random to "no")(display:"night")]
(else:)[(if: $random is "yes")[(display: "roll them bones")]
[[go east->F15]]
[[go south->F09]]
(if: $location is "forest2")[(link:"go west")[(set: $location to "forest1")(go-to:"F13")]]]
(set: $random to (either:"yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)To the west, east and south there are paths. To the north, the forest grows too thick to explore.](if: $dungeon contains $location)[To the north is the stone wall of the dungeon.]
(if: $turn is 10)[(set: $random to "no")(display:"night")]
(else:)[(if: $random is "yes")[(display:"roll them bones")]
[[go west->F16]]
[[go east->F14]]
[[go south->F10]]]
(set: $random to (either: "yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)To the north, the forest seems too dark and thick to explore, but in all other directions there are paths.[(if: $location is "forest1")[
Oh, no, wait. That's not true. Here it looks like you could go north, if you really wanted to.]]](if: $dungeon contains $location)[To the north is the stone wall of the dungeon.]
(if: $turn is 10)[(set: $random to "no")(display:"night")]
(else:)[(if: $random is "yes")[(display:"roll them bones")]
[[go west->F15]]
[[go east->F13]]
[[go south->F11]]
[[go north->town]]]
(set: $random to (either: "yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)](if: $location is "forest1")[To the east, west, and south are paths. To the north, the forest is too dense to traverse.](if: $location is "forest2")[To the east is a small, guarded door in the wall of the Kingdom Accalon.](if: $location is "dungeon1")[To the west and south is more dungeon. To your east are stairs.](if: $location is "dungeon2")[To your west and south is more dungeon. To your east is (if: $dragon is "dead")[the door you just came through](else:)[a door].]
(if: $turn is 10)[(set: $random to "no")(display: "night")]
(else:)[(if: $random is "yes")[(display:"roll them bones")]
[[go west->F14]]
[[go south->F12]]
(if: $location is "forest1")[(link: "go east")[(set: $location to "forest2")(go-to: "F16")]](if: $location is "forest2")[(link: "bribe guard")[(set: $turn to 0)(set: $location to "dungeon1")(go-to: "bribe the guard")]](if: $location is "dungeon1")[(link:"descend")[(set: $location to "dungeon2")(go-to:"F01")]](if: $location is "dungeon2")[(if: $dragon is "dead")[](else:)[(link:"open the door")[(go-to:"open the door")]]]]
(set: $random to (either: "yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 10)](if: $location is "forest1")[To your west the forest is too dense to go through, but in all other directions there are paths.](if: $location is "forest2")[In all directions there is more forest.](if: $dungeon contains $location)[To the west is the stone wall of the dungeon.]
(if: $turn is 10)[(set: $random to "no")(display: "night")]
(else:)[(if: $random is "yes")[(display: "roll them bones")]
[[go south->F08]]
[[go east->F10]]
[[go north->F16]]
(if: $location is "forest2")[(link:"go west")[(set: $location to "forest1")(go-to:"F05")]]]
(set: $random to (either:"yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[In all directions is more and more forest.](if: $dungeon contains $location)[In all directions is simply more dungeon.]
(if: $turn is 10)[(display: "night")]
(else:)[(if: $random is "yes")[(display: "roll them bones")]
[[go east->F11]]
[[go west->F09]]
[[go north->F15]]
[[go south->F07]]]
(set: $random to (either:"yes", "no"))(set: $encounter to (random: 1,20))(if: $wizard is "yes")[(set: $random to "no")](if: $forest contains $location)[(if: $historyadj's last is "F11")[](else:)[(set: $turn to it + 1)]](if: $turn is 10)[(set: $random to "no")(display: "night")](else:)[(if: $location is "forest1")[(if: $random is "yes")[You find yourself in a clearing.
At one side of it, there is a small house.
(link:"investigate")[(set: $wizard to "yes")(go-to:"forest wizard")]](else:)[You find yourself in a clearing. In all directions is more forest.
]](if: $location is "forest2")[In all directions is more explorable forest.
](if: $dungeon contains $location)[All around you is dungeon.]
[[go west->F10]]
[[go east->F12]]
[[go south->F06]]
[[go north->F14]]]
(set: $random to (either: "yes", "no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)](if: $location is "forest1")[In all directions are paths leading off into more and more forest.]
(if: $location is "forest2")[To your east are the walls of the Kingdom Accalon. To the south, west, and north are paths off into forest.](if: $dungeon contains $location)[To the south, west, and north is more dungeon; to the east is a stone wall.]
(if: $turn is 10)[(set: $random to "no")(display: "night")]
(else:)[(if: $random is "yes")[(display: "roll them bones")]
[[go south->F05]]
[[go west->F11]]
[[go north->F13]]
(if: $location is "forest1")[(link: "go east")[(set: $location to "forest2")(go-to:"F09")]]]
(set: $random to (either: "yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 10)](if: $location is "forest1")[To your west the forest is too dense to go through, but in all other directions there are paths.](if: $location is "forest2")[In all directions there is more forest.](if: $dungeon contains $location)[To your west is the stone wall of the dungeon.]
(if: $turn is 10)[(set: $random to "no")(display: "night")]
(else:)[(if: $random is "yes")[(display: "roll them bones")]
[[go east->F07]]
[[go north->F09]]
[[go south->F01]]
(if: $location is "forest2")[(link:"go west")[(set: $location to "forest1")(go-to:"F05")]]]
(set: $random to (either:"yes", "no"))(set: $encounter to (random: 1,20))(if: $wizard is "yes")[(set: $random to "no")](if: $forest contains $location)[(if: $historyadj's last is "forest wizard")[](else:)[(set: $turn to it + 1)]](if: $turn is 10)[(set: $random to "no")(display: "night")](else:)[(if: $location is "forest1")[(if: $random is "yes")[You find yourself in a clearing.
At one side of it, there is a small house.
(link:"investigate")[(set: $wizard to "yes")(go-to:"forest wizard")]](else:)[You find yourself in a clearing. In all directions is more forest.
]](if: $location is "forest2")[In all directions is more explorable forest.
](if: $dungeon contains $location)[In all directions is simply more dungeon.]
[[go east->F06]]
[[go west->F08]]
[[go north->F10]]
[[go south->F02]]]
(set: $random to (either: "yes", "no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)](if: $location is "forest1")[In all directions are paths leading off into more and more forest.]
(if: $location is "forest2")[To your east are the walls of the Kingdom Accalon. To the south, west, and north are paths off into forest.](if: $dungeon contains $location)[You can go south, west, and north, and to the east is the stone wall of the dungeon.]
(if: $turn is 10)[(set: $random to "no")(display: "night")]
(else:)[(if: $random is "yes")[(display: "roll them bones")]
[[go south->F04]]
[[go west->F06]]
[[go north->F12]]
(if: $location is "forest1")[(link: "go east")[(set: $location to "forest2")(go-to:"F08")]]]
(set: $random to (either:"yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)In all directions are paths leading to more forest.](if: $dungeon contains $location)[In all directions is simply more dungeon.]
(if: $turn is 10)[(set: $random to "no")(display: "night")]
(else:)[(if: $random is "yes")[(display: "roll them bones")]
[[go west->F07]]
[[go north->F11]]
[[go east->F05]]
[[go south->F03]]]
(set: $random to (either: "yes", "no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)](if: $location is "forest1")[You are in the forest.
To the east and north of you are paths, leading off further into the forest. To the southwest of you is the walled city of the castle. To your west is forest too dense and overgrown for you to get through, even with effort. To the south is the river Marrok, which provides the water for the people of the city.](if: $location is "forest2")[To the north, east, and west of you are paths which lead to more forest. To the south is the river Marrok.
](if: $location is "dungeon1")[You are in the dungeon of the Castle Accalon. From here you can go either north or east, as to your south and west are stone walls.You may also return to the forest.](if: $location is "dungeon2")[You are in the second level of the dungeon of the Castle Accalon. From here you can go either north or east, as to your south and west are stone walls. You may also ascend the stairs and return to the first level of the dungeon.]
(if: $turn is 10)[
(set: $random to "no")(display: "night")](else:)[
(if: $random is "yes")[(display: "roll them bones")]
[[go north->F08]]
[[go east->F02]]]
(if: $location is "forest2")[(link:"go west")[(set: $location to "forest1")(go-to: "F04")]](if: $location is "forest1")[(if: $princess is "yes")[(link: "return to castle")[(set: $location to "castle")(set: $lawful to 5)(go-to: "castle")]]](if: $location is "dungeon1")[(link:"return to forest")[(set: $location to "forest2")(go-to:"F13")]](if: $location is "dungeon2")[(link: "ascend")[(set: $location to "dungeon1")(go-to: "F13")]]
(set: $random to (either:"yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)](if: $location is "forest1")[
To the west, north, and east are paths into the forest. To the south is the river Marrok.
]
(if: $location is "forest2")[To the west and north there are paths leading off into to yet more forest. To your east you can see the walls of Kingdom Accalon. To the south is the river Marrok.
](if: $dungeon contains $location)[To your south and east are stone wall.
](if: $turn is 10)[(set: $random to "no")(display:"night")]
(else:)[(if: $random is "yes")[(display:"roll them bones")]
[[go west->F03]]
[[go north->F05]]
(if: $location is "forest1")[(link:"go east")[(set: $location to "forest2")(go-to:"F01")]]]
(set: $random to (either: "yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)To the west, north, and east there are paths leading into the forest. To the south is the river Marrok.
](if: $dungeon contains $location)[To the west, north and east is more dungeon. To the south is a stone wall.
]
(if: $turn is 10)[(set: $random to "no")(display: "night")]
(else:)[(if: $random is "yes")[(display: "roll them bones")]
[[go west->F02]]
[[go north->F06]]
[[go east->F04]]]
(set: $random to (either:"yes","no"))(set: $encounter to (random: 1,20))(if: $forest contains $location)[(set: $turn to it + 1)There are paths to your north, west and east. To your south is the river Marrok.
](if: $dungeon contains $location)[You can go to your north, west, or east. To the south is a stone wall.
](if: $turn is 10)[
(set: $random to "no")(display: "night")]
(else:)[(if: $random is "yes")[
(display: "roll them bones")]
[[go west->F01]]
[[go north->F07]]
[[go east->F03]]]
{(if: $heal is "yes")[You heal yourself by (min:$levelheal,$hpmax - $hpcurr) HP.(if: $hpcurr + $levelheal >= $hpmax)[(set: $hpcurr to $hpmax)](else:)[(set: $hpcurr to $hpcurr + $levelheal)](set: $heal to "no")(replace: ?stats)[(display:"stats")]](else:)[]
(if: $manaheal is "yes")[You restore (min:$levelheal,($manamax - $manacurr)) MP.(if: ($manacurr + $levelheal) > $manamax)[(set: $manacurr to $manamax)](else:)[(set: $manacurr to $manacurr + $levelheal)](set: $manaheal to "no")(replace: ?stats)[(display:"stats")]](else:)[]
(set: $plaInit to ((random:1,10) + 0.5*$luck + 2*$level + 0.5*$dex)*$acc)(set: $monInit to (random:3,18) + $monlevel)
}You are fighting a level $monlevel $monster.
{(if: $plaInit > $monInit)[
(if: $spell is 0)[(set: $playerdmg to $weapondmg)]You attack the $monster with (if: $spell is 0)[your $weapon(set: $weaponuse to it - 1)](else:)[$spell] for $playerdmg damage. (set: $monhpcurr to it - $playerdmg)(replace: ?stats)[(display:"stats")](if: $weaponuse is 0)[(if: $weapon is "bow")[(if: $arrowseq is 0)[You are out of arrows.]](if: $weapon is "your fists")[](else:)[Your $weapon breaks.(set: $weapon to "your fists")]]
<br><br>
(set: $monInit2 to (random: 1, 20))(if: $even2 contains $monInit2)[The $monster attacks you for $mondmg damage.(set: $hpcurr to it - $mondmg)(set: $armdur to it - 1)
(if: $odd2 contains $monInit2)[The $monster attempts to attack you, but misses.]
(if: $monInit2 is 1)[The $monster attempts to attack you, but fumbles, hurting (if: $monster is "guard")[himself](else:)[itself].(set: $monhpcurr to it - 2)]
]
(elseif: $monInit > $plaInit)[(set: $hpcurr to it - $mondmg)You miss.
<br><br>
The $monster attacks you for $mondmg damage. (replace: ?stats)[(display:"stats")]]
(elseif: $plaInit is $monInit)[You miss.
<br><br>
The $monster misses.]
}
(if: $hpcurr <= 0)[
You have died.
(link:"new game")[(set: (saved-games:) to (saved-games:) - (a: "game"))(go-to:"title")]
{(if: (saved-games:) contains "game")[
(link: "load game")[(load-game:"game")]
]}](elseif: $hpcurr > 0)[
You have $hpcurr HP and $manacurr MP.
(if: $monhpcurr > 0)[
(if: $weapon is "bow")[(link-replace: "attack with $weapon")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to 0)(set: $arrowseq to it - 1)(go-to:"encounter")]](if: $weapon is 0)[(link-replace: "attack with your fists")[(set: $spell to 0)(set: $plaInit to 0)(set: $monInit to 0)(go-to:"encounter")]](else:)[(link-replace: "attack with $weapon")[(set: $spell to 0)(set: $plaInit to 0)(set: $monInit to 0)(go-to:"encounter")]](if: $spells contains "fireball")[
(if: $manacurr >= $fireball's cost)[(link-replace: "attack with fireball")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "fireball")(set: $playerdmg to $firedmg)(set: $manacurr to it - $fireball's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "frostbite")[
(if: $manacurr >= $frostbite's cost)[(link-replace: "attack with frostbite")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "frostbite")(set: $playerdmg to $frostdmg)(set: $manacurr to it - $frostbite's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "lightning bolt")[
(if: $manacurr >= $lightningbolt's cost)[(link-replace: "attack with lightning bolt")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "lightning bolt")(set: $playerdmg to $lightdmg)(set: $manacurr to it - $lightningbolt's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "acid splash")[
(if: $manacurr >= $acidsplash's cost)[(link-replace: "attack with acid splash")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "acid splash")(set: $playerdmg to $aciddmg)(set: $manacurr to it - $acidsplash's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "earthquake")[
(if: $manacurr >= $earthquake's cost)[(link-replace: "attack with earthquake")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "earthquake")(set: $playerdmg to $earthdmg)(set: $manacurr to it - $earthquake's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "hail of thorns")[
(if: $manacurr >= $hailofthorns's cost)[(link-replace: "attack with hail of thorns")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "hail of thorns")(set: $playerdmg to $thornsdmg)(set: $manacurr to it - $hailofthorns's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "heal")[
(if: $manacurr >= $healspell's cost)[(set: $spell to 0)(link-replace: "heal with spell")[(set: $plaInit to 0)(set: $monInit to 0)(set: $heal to "yes")(set: $manacurr to it - $healspell's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $healthpotion's count >= 1)[
(link-replace: "heal with potion")[(set: $plaInit to 0)(set: $monInit to 0)(set: $heal to "yes")(set: $spell to 0)(set: $healthpotion's count to it - 1)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[](if: $manapotion's count >= 1)[
(link-replace: "restore mana")[(set: $plaInit to 0)(set: $monInit to 0)(set: $manaheal to "yes")(set: $spell to 0)(set: $manapotion's count to it - 1)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]
(link: "run away")[(go-to: $historyadj's last)]]
(elseif: $monhpcurr <= 0)[You have defeated the $monster!
(if: $weapon is "bow")[(set: $random2 to (random: 1, 20))(if: $even2 contains $random2)[You are able to retrieve an arrow.(set: $arrow's count to it + 1)]
(if: $random2 is 20)[You are able to retrieve two of your arrows.(set: $arrow's count to it + 2)]] You gain (if: $monsterspoils is $D)[](else:)[(print: $monsterspoils.join(", ")), ]$goldgain GP and $xpgain XP. (set: $xpcurr to it + $xpgain)(set: $gold to it + $goldgain)(replace: ?stats)[(display: "stats")](if: $int is < 20)[(set: $xplevel to ($level*$level + 25))]
(else:)[(set: $xplevel to ($level*$level + 20))]
(set: $xpnext to ($xplevel - $xpcurr))(if: $xpcurr >= $xplevel)[(set: $level to it + 1)(if: $int is < 20)[(set: $xplevel to ($level*$level + 25))]
(else:)[(set: $xplevel to ($level*$level + 20))]
(set: $xpnext to ($xplevel - $xpcurr))(replace: ?stats)[(display: "stats")]
You have gained a level!(set: $hpcurr to $hpmax)(set: $xpcurr to 0)(set: $manacurr to $manamax)]{(if: $monsterspoils is $E)[(set: $goblinmeat's count to it + 1)(set: $goblinhand's count to it + 1)(set: $manapotion's count to it + 1)(set: $healthpotion's count to it + 1)]
(if: $monsterspoils is $F)[(set: $goblinmeat's count to it + 1)(set: $goblinhand's count to it + 1)(set: $key's count to it + 1)(set: $lightarmor's count to it + 1)]
(if: $monsterspoils is $G)[(set: $goblinmeat's count to it + 1)(set: $goblinhand's count to it + 1)(set: $key's count to it + 1)(set: $sword's count to it + 1)]
(if: $monsterspoils is $H)[(set: $goblinmeat's count to it + 1)(set: $goblinhand's count to it + 1)]
(if: $monsterspoils is $P)[(set: $trollscalp's count to it + 1)(set: $mace's count to it + 1)(set: $key's count to it + 1)(set: $healthpotion's count to it + 1)]
(if: $monsterspoils is $Q)[(set: $trollscalp's count to it + 1)(set: $axe's count to it + 1)(set: $key's count to it + 1)(set: $manapotion's count to it + 1)]
(if: $monsterspoils is $R)[(set: $trollscalp's count to it + 1)]
(if: $monsterspoils is $S)[(set: $trollscalp's count to it + 1)(set: $key's count to it + 1)(if: $S contains "plate helm")[(set: $platehelm's count to it + 1)](if: $S contains "plate breastpiece")[(set: $platebreastpiece's count to it + 1)](if: $S contains "plate gloves")[(set: $plateglove's count to it + 1)](if: $S contains "plate greaves")[(set: $plategreave's count to it + 1)](if: $S contains "plate boots")[(set: $plateboot's count to it + 1)]]
(if: $monsterspoils is $T)[(set: $finger's count to it + 1)(set: $key's count to it + 5)]
(if: $monsterspoils is $U)[(set: $finger's count to it + 1)(set: $key's count to it + 1)(set: $mace's count to it + 1)]
(if: $monsterspoils is $V)[(set: $finger's count to it + 1)(set: $key's count to it + 1)(if: $V contains "leather coif")[(set: $leathercoif's count to it + 1)](if: $V contains "leather tunic")[(set: $leathertunic's count to it + 1)](if: $V contains "leather gloves")[(set: $leatherglove's count to it + 1)](if: $V contains "leather leggings")[(set: $leatherlegging's count to it + 1)](if: $S contains "plate boots")[(set: $plateboot's count to it + 1)]]
(if: $monsterspoils is $W)[(set: $finger's count to it + 1)]
(if: $monsterspoils is $Y)[(set: $beholdereye's count to it + 1)]}
(if: $historyadj's last is "bribe the guard")[(link:"enter the dungeon")[(set: $location to "dungeon1")(go-to:"F01")]](else:)[(link: "continue")[(go-to: $historyadj's last)]]
]]
{(set: $light to (either:"leather coif", "leather boots","leather tunic", "leather leggings", "leather gloves"))
(set: $monster to "guard")(set: $monlevel to $level + (random:1,3))(set: $monhpmax to ($monlevel*7) + 10)(set: $monhpcurr to $monhpmax)
(set: $monsterspoils to (either: $T, $U, $V, $W, $D))}
(if:(history:)'s last is "bribe the guard")[Looks like you're going to have to do this the old fashioned way.(set: $goldgain to it + $gold)](else:)[You investigate the thud and find a guard. He hasn't noticed you yet but it's only a matter of time.]
(link: "attack with sword")[(go-to: "encounter")]
(display: "spells encounter")
(link: "run away")[(go-to: $historyadj's last)]
{(set: $monster to "dragon")(set: $monlevel to 25)(set: $dragonhpmax to 1000)(set: $monhpcurr to $dragonhpmax)(set: $dragondmg to (random: 100, 250))
(if: $heal is "yes")[You heal yourself by (min:$levelheal,$hpmax - $hpcurr) HP.(if: $hpcurr + $levelheal >= $hpmax)[(set: $hpcurr to $hpmax)](else:)[(set: $hpcurr to $hpcurr + $levelheal)](set: $heal to "no")(replace: ?stats)[(display:"stats")]](else:)[]
(if: $manaheal is "yes")[You restore (min:$levelheal,($manamax - $manacurr)) MP.(if: ($manacurr + $levelheal) > $manamax)[(set: $manacurr to $manamax)](else:)[(set: $manacurr to $manacurr + $levelheal)](set: $manaheal to "no")(replace: ?stats)[(display:"stats")]](else:)[]
(set: $plaInit to ((random:1,10) + 0.5*$luck + 2*$level + 0.5*$dex)*$acc)(set: $monInit to (random:3,18) + $monlevel)
(replace: ?stats)[(display: "stats")]
}You are fighting a level $monlevel $monster.
{(if: $plaInit > $monInit)[
(if: $spell is 0)[(set: $playerdmg to $weapondmg)]You attack the $monster with (if: $spell is 0)[your $weapon(set: $weaponuse to it - 1)](else:)[$spell] for $playerdmg damage. (set: $monhpcurr to it - $playerdmg)(replace: ?stats)[(display:"stats")](if: $weaponuse is 0)[(if: $weapon is "bow")[(if: $arrowseq is 0)[You are out of arrows.]](if: $weapon is "your fists")[](else:)[Your $weapon breaks.(set: $weapon to "your fists")]]<br><br>
(set: $monInit2 to (random: 1, 20))(if: $even2 contains $monInit2)[The $monster attacks you for $dragondmg damage.(set: $hpcurr to it - $dragondmg)]
(if: $odd2 contains $monInit2)[The $monster attempts to attack you, but misses.]
(if: $monInit2 is 1)[The $monster attempts to attack you, but fumbles, hurting (if: $monster is "guard")[himself](else:)[itself].(set: $monhpcurr to it - 2)]
]
(elseif: $monInit > $plaInit)[(set: $hpcurr to it - $dragondmg)You miss. The $monster attacks you for $dragondmg damage. (replace: ?stats)[(display:"stats")]]
(elseif: $monInit is $plaInit)[You miss.
<br><br>
The $monster misses.]
}
(if: $hpcurr <= 0)[
You have died.
(link:"new game")[(go-to:"title")]
{(if: (saved-games:) contains "game")[
(link: "load game")[(load-game:"game")]
]}]
(elseif: $hpcurr > 0)[
You have $hpcurr HP and $manacurr MP.
(if: $monhpcurr > 0)[
(if: $weapon is "bow")[(link-replace: "attack with $weapon")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to 0)(set: $arrowseq to it - 1)(go-to:"dragon")]](if: $weapon is 0)[(link-replace: "attack with your fists")[(set: $spell to 0)(set: $plaInit to 0)(set: $monInit to 0)(go-to:"dragon")]](else:)[(link-replace: "attack with $weapon")[(set: $spell to 0)(set: $plaInit to 0)(set: $monInit to 0)(go-to:"dragon")]](if: $spells contains "fireball")[
(if: $manacurr >= $fireball's cost)[(link-replace: "attack with fireball")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "fireball")(set: $playerdmg to $fireball's dmg)(set: $manacurr to it - $fireball's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "frostbite")[
(if: $manacurr >= $frostbite's cost)[(link-replace: "attack with frostbite")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "frostbite")(set: $playerdmg to $frostbite's dmg)(set: $manacurr to it - $frostbite's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "lightning bolt")[
(if: $manacurr >= $lightningbolt's cost)[(link-replace: "attack with lightning bolt")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "lightning bolt")(set: $playerdmg to $lightningbolt's dmg)(set: $manacurr to it - $lightningbolt's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "acid splash")[
(if: $manacurr >= $acidsplash's cost)[(link-replace: "attack with acid splash")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "acid splash")(set: $playerdmg to $acidsplash's dmg)(set: $manacurr to it - $acidsplash's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "earthquake")[
(if: $manacurr >= $earthquake's cost)[(link-replace: "attack with earthquake")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "earthquake")(set: $playerdmg to $earthquake's dmg)(set: $manacurr to it - $earthquake's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "hail of thorns")[
(if: $manacurr >= $hailofthorn's cost)[(link-replace: "attack with hail of thorns")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "hail of thorns")(set: $playerdmg to $hailofthorn's dmg)(set: $manacurr to it - $hailofthorn's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "heal")[
(if: $manacurr >= $healspell's cost)[(set: $spell to 0)(link-replace: "heal with spell")[(set: $plaInit to 0)(set: $monInit to 0)(set: $heal to "yes")(set: $manacurr to it - $healspell's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $healthpotion's count >= 1)[
(link-replace: "heal with potion")[(set: $plaInit to 0)(set: $monInit to 0)(set: $heal to "yes")(set: $spell to 0)(set: $healthpotion's count to it - 1)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[](if: $manapotion's count >= 1)[
(link-replace: "restore mana")[(set: $plaInit to 0)(set: $monInit to 0)(set: $manaheal to "yes")(set: $spell to 0)(set: $manapotion's count to it - 1)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]
(link: "run away")[(go-to: $historyadj's last)]]
(elseif: $monhpcurr <= 0)[You have defeated the $monster!
(if: $weapon is "bow")[(set: $random2 to (random: 1, 20))(if: $even2 contains $random2)[You are able to retrieve an arrow.(set: $arrow's count to it + 1)]
(if: $random2 is 20)[You are able to retrieve two of your arrows.(set: $arrow's count to it + 2)]] You gain $xpgaindragon XP. The way to the princess is more or less clear (if you don't count the massive corpse in front of you).(set: $xpcurr to it + $xpgaindragon)(replace: ?stats)[(display: "stats")](if: $int is < 20)[(set: $xplevel to ($level*10 + 15))]
(else:)[(set: $xplevel to ($level*10 + 10))]
(set: $xpnext to ($xplevel - $xpcurr))(if: $xpcurr >= $xplevel)[(set: $level to it + 1)(if: $int is < 20)[(set: $xplevel to ($level*10 + 15))]
(else:)[(set: $xplevel to ($level*10 + 10))]
(set: $xpnext to ($xplevel - $xpcurr))(replace: ?stats)[(display: "stats")]
You have gained a level!(set: $hpcurr to $hpmax)(set: $xpcurr to 0)(set: $manacurr to $manamax)]
(link:"rescue the princess")[(set: $dragon to "dead")(go-to:"princess")]
]]
{(set: $heavy to (either:"plate helm","plate boots","plate breastpiece","plate greaves", "plate gloves"))
(set: $monster to "troll")(set: $monlevel to $level + (random:1,3))(set: $monhpmax to ($monlevel*7) + 10)(set: $monhpcurr to $monhpmax)
(set: $monsterspoils to (either: $D, $P, $Q, $R, $S))}
You investigate and find a troll! It doesn't seem to have noticed you.
(link:"attack with $weapon")[(go-to: "encounter")]
(display: "spells encounter")
(link:"run away")[(go-to: $historyadj's last)]
{(set: $animal to "rabbit")(set: $anilevel to $level + (random:0,3))(set: $anihpmax to ($anilevel*2 + 10))(set: $anihpcurr to $anihpmax)
(set: $animalspoils to (either: $A, $B, $C, $D))}
You investigate the rustling and find a rabbit!
(link:"attack with $weapon")[(go-to: "animal")]
(display:"spells animal")
(link:"leave it be")[(go-to: $historyadj's last)]
{(set: $monster to "goblin")(set: $monlevel to $level + (random:1,3))(set: $monhpmax to ($monlevel*7) + 10)(set: $monhpcurr to $monhpmax)
(set: $monsterspoils to (either: $E, $F, $G, $H, $D))}
You investigate and find a goblin! It doesn't seem to have noticed you.
(link:"attack with $weapon")[(go-to: "encounter")]
(display: "spells encounter")
(link:"run away")[(go-to: $historyadj's last)]
{(set: $animal to "bat")(set: $anilevel to $level + (random:0,3))(set: $anihpmax to ($anilevel*2 + 10))(set: $anihpcurr to $anihpmax)
(set: $animalspoils to (either: $D, $J, $K, $L))}
You investigate the noise and find a bat!
(link:"attack with $weapon")[(go-to: "animal")]
(display: "spells animal")
(link:"run away")[(go-to: $historyadj's last)]
{(set: $monster to "beholder")(set: $monlevel to $level + (random:1,3))(set: $monhpmax to ($monlevel*7) + 10)(set: $monhpcurr to $monhpmax)
(set: $monsterspoils to $Y)}
You find a beholder! Despite it's hundreds of eyes, it doesn't seem to have noticed you yet.
(link:"attack with $weapon")[(go-to: "encounter")]
(display: "spells encounter")
(link:"run away")[(go-to: $historyadj's last)]
{(set: $animal to "wolf")(set: $anilevel to $level + (random:0,3))(set: $anihpmax to ($anilevel*2 + 10))(set: $anihpcurr to $anihpmax)
(set: $animalspoils to (either: $A, $B, $C, $D))}
You go to investigate the rustling and find a wolf!!
(link:"attack with $weapon")[(go-to: "animal")]
(display: "spells animal")
(link:"run away")[(go-to: $historyadj's last)]
{(set: $light to (either:"leather coif","leather tunic","leather gloves","leather leggings", "leather boots"))
(set: $medium to (either:"chain coif","chain shirt", "chain gloves", "chain leggings", "chain boots"))
(set: $heavy to (either:"plate helm","plate breastpiece","plate gloves","plate greaves", "plate boots"))
(set: $treasureA to (a: (either:"", $legendaryweapname)))(set: $treasureB to (a: (either:"",$legendaryarmorname)))(set: $treasureC to (a: (either: "a sword", "a dagger","a mace","an axe","a bow", "50 arrows", "a staff", "")))(set: $treasureD to (a: (either: $light, $medium, $heavy)))(set: $treasureitems to (a:"2 mana potions", "2 health potions"))(if: $legendaryweap is 0)[(set: $treasureitems to it + (a:$treasureA))](if: $legendaryarmor is 0)[(set: $treasureitems to it + (a:$treasureB))](set: $treasureitems to it + (a:$treasureC))(set: $treasureitems to it + (a:$treasureD))}
|treasure>[You must have imagined the noise, because when you go to look, all you find is a treasure chest.
(if: $key's count >= 1)[(link-replace:"open chest")[(set: $key's count to it - 1)(replace: ?treasure)[You open the chest and find (print:$treasureitems.join(", ")) and $treasure GP. You also gain $xpgain XP.](set: $gold to it + $treasure)(set: $manapotion's count to it + 2)(set: $healthpotion's count to it + 2)(if: $treasureitems contains (a:$legendaryweapname))[(set: $legendaryweapon's count to it + 1)(set: $legendaryweap to 1)](if: $treasureitems contains (a:$legendaryarmorname))[(set: $legendaryarmor's count to it + 1)(set: $legendaryarmor to 1)](if: $treasureitems contains (a:"a sword"))[(set: $sword's count to it + 1)](if: $treasureitems contains (a:"an axe"))[(set: $axe's count to it + 1)](if: $treasureitems contains (a:"a mace"))[(set: $mace's count to it + 1)](if: $treasureitems contains (a:"a staff"))[(set: $staff's count to it + 1)](if: $treasureitems contains (a:"a bow"))[(set: $bow's count to it + 1)](if: $treasureitems contains (a:"a dagger"))[(set: $dagger's count to it + 1)](if: $treasureitems contains (a:"50 arrows"))[(set: $arrow's count to it + 50)](if: $treasureitems contains $light)[(if: $treasureitems contains "leather coif")[(set: $leathercoif's count to it + 1)](if: $treasureitems contains "leather tunic")[(set: $leathertunic's count to it + 1)](if: $treasureitems contains "leather gloves")[(set: $leatherglove's count to it + 1)](if: $treasureitems contains "leather leggings")[(set: $leatherlegging's count to it + 1)](if: $treasureitems contains "leather boots")[(set: $leatherboot's count to it + 1)]](if: $treasureitems contains $medium)[(if: $treasureitems contains "chain coif")[(set: $chaincoif's count to it + 1)](if: $treasureitems contains "chain shirt")[(set: $chainshirt to it + 1)](if: $treasureitems contains "chain gloves")[(set: $chainglove's count to it + 1)](if: $treasureitems contains "chain leggings")[(set: $chainlegging's count to it + 1)](if: $treasureitems contains "chain boots")[(set: $chainboot's count to it + 1)]](if: $treasureitems contains $heavy)[(if: $treasureitems contains "plate helm")[(set: $platehelm's count to it + 1)](if: $treasureitems contains "plate breastpiece")[(set: $platebreastpiece's count to it + 1)](if: $treasureitems contains "plate gloves")[(set: $plateglove's count to it + 1)](if: $treasureitems contains "plate greaves")[(set: $plategreave's count to it + 1)](if: $treasureitems contains "plate boots")[(set: $plateboot's count to it + 1)]](set: $xpcurr to it + $xpgain)(if: $int is < 20)[(set: $xplevel to ($level*10 + 15))](else:)[(set: $xplevel to ($level*10 + 10))]
(set: $xpnext to ($xplevel - $xpcurr))(if: $xpcurr >= $xplevel)[You have gained a level!(set: $level to it + 1)(if: $int is < 20)[(set: $xplevel to ($level*$level + 25))]
(else:)[(set: $xplevel to ($level*$level + 20))](replace: ?stats)[(display:"stats")]]]]
(elseif: $key's count is 0)[If only you had a key...]]
(link:"back")[(go-to: $historyadj's last)]
{(set: $animal to "group of rats")(set: $anilevel to $level + (random:0,3))(set: $anihpmax to ($anilevel*2 + 10))(set: $anihpcurr to $anihpmax)
(set: $animalspoils to (either: $D, $X))}
You investigate and find a group of rats! Gross!
(link:"attack with $weapon")[(go-to: "animal")]
(display: "spells animal")
(link:"run away")[(go-to: $historyadj's last)]
{(if: $xpcurr >= $xplevel)[(set: $level to it + 1)(set: $xpcurr to it - $xplevel)(if: $int < 20)[(set: $xplevel to $level*$level + 25)](else:)[(set: $xplevel to $level*$level + 20)]You have gained a level!(replace: ?stats)[(display: "stats")]]}
[[inventory]]
[[shop]]
(if: (history:) contains "town")[ [[town]]]
{
(print: "<script>$('html').removeClass(\)</script>")
(if: (passage:)'s tags's length > 0)[
(print: "<script>$('html').addClass('" + (passage:)'s tags.join(' ') + "'\)</script>")
]
}
You have |gold>[$gold] GP.
(set: $allspells to (a: "fireball", "frostbite", "lightning bolt", "hail of thorns", "acid splash", "earthquake", "heal", "make fire"))
(link-reveal:"SPELLS")[(if: $spells contains "fireball")[](else:)[
(link-replace: "fireball - (text:$fireball's price) GP")[(if: $gold < $fireball's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "fireball"))(set: $gold to $gold - $fireball's price)You have learned fireball.(replace: ?gold)[$gold]]](if: $spells contains "frostbite")[](else:)[
(link-replace: "frostbite - (text:$frostbite's price) GP")[(if: $gold < $frostbite's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "frostbite"))(set: $gold to $gold - $frostbite's price)You have learned frostbite.(replace: ?gold)[$gold]]]](if: $spells contains "lightning bolt")[](else:)[
(link-replace: "lightning bolt - (text: $lightningbolt's price) GP")[(if: $gold < $lightningbolt's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "lightning bolt"))(set: $gold to $gold - $lightningbolt's price)You have learned lightning bolt.(replace: ?gold)[$gold]]]](if: $spells contains "acid splash")[](else:)[
(link-replace: "acid splash - (text:$acidsplash's price) GP")[(if: $gold < $acidsplash's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "acid splash"))(set: $gold to $gold - $acidsplash's price)You have learned acid splash.(replace: ?gold)[$gold]]]](if: $spells contains "earthquake")[](else:)[
(link-replace: "earthquake - (text:$earthquake's price) GP")[(if: $gold < $earthquake's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "earthquake"))(set: $gold to $gold - $earthquake's price)You have learned earthquake.(replace: ?gold)[$gold]]]](if: $spells contains "hail of thorns")[](else:)[
(link-replace: "hail of thorns - (text:$hailofthorn's price) GP")[(if: $gold < $hailofthorn's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "hail of thorns"))(set: $gold to $gold - $hailofthorn's price)You have learned hail of thorns.(replace: ?gold)[$gold]]]]
(if: $spells contains "heal")[](else:)[
(link-replace: "heal - (text:$healspell's price) GP")[(if: $gold < $healspell's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "heal"))(set: $gold to $gold - $healspell's price)You have learned heal.(replace: ?gold)[$gold]]]](if: $spells contains "make fire")[](else:)[
(link-replace: "make fire - (text:$makefire's price) GP")[(if: $gold < $makefire's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "make fire"))(set: $gold to $gold - $makefire's price)You have learned make fire.(replace: ?gold)[$gold]]]]
(if: $spells contains $allspells)[You know all the spells this shop has to offer.]]]
(link-reveal:"POTIONS")[
(link-replace: "health potion - (text: $healthpotion's price) GP")[(if: $gold < $healthpotion's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $healthpotion's price)(set: $healthpotion's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "mana potion - (text: $manapotion's price) GP")[(if: $gold < $manapotion's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $manapotion's price)(set: $manapotion's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]]
(link-reveal:"ARMOR")[
(link-replace: "leather tunic (+(text: $leathertunic's armor)) - (text: $leathertunic's price) GP")[(if: $gold < $leathertunic's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $leathertunic's price)(set: $leathertunic's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "chain shirt (+(text:$chainshirt's armor)) - (text:$chainshirt's price) GP")[(if: $gold < $chainshirt's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $chainshirt's price)(set: $chainshirt's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "plate breastpiece (+(text: $platebreastpiece's armor)) - (text:$platebreastpiece's price) GP")[(if: $gold < $platebreastpiece's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $platebreastpiece's price)(set: $platebreastpiece's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]]
(link-reveal:"WEAPONS")[
(link-replace: "axe (+(text: $axe's atk))- (text:$axe's price) GP")[(if: $gold < $axe's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $axe's price)(set: $axe's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]
(link-replace: "dagger (+(text:$dagger's atk))- (text:$dagger's price) GP")[(if: $gold < $dagger's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $dagger's price)(set: $dagger's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "mace (+(text:$mace's atk))- (text:$mace's price) GP")[(if: $gold < $mace's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $mace's price)(set: $mace's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "staff (+(text:$staff's atk))- (text:$staff's price) GP")[(if: $gold < $staff's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $staff's price)(set: $staff's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]
(link-replace: "sword (+(text:$sword's atk))- (text:$sword's price) GP")[(if: $gold < $sword's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $sword's price)(set: $sword's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]
(link-replace: "bow (no arrows)- (text:$bow's price) GP")[(if: $gold < $bow's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $bow's price)(set: $bow's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]
(link-replace: "10 arrows (+(text:$bow's atk))- (text:$arrow's price) GP")[(if: $gold < $arrow's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $arrow's price)(set: $arrow's count to it + 10)You have purchased 10 arrows.(replace: ?gold)[$gold](go-to: "shop")]]]
(link-reveal:"LESSONS")[
(display:"lessons")]
REPAIR:
(set: $weaponrepaircost to (($usemax - $weaponuse)*10))(set: $armorrepaircost to (($armdurmax - $armdur)*10))
(if: $weapon is "bow")[](else:)[(if: $gold < $weaponrepaircost)[repair equipped weapon (link-replace"$weaponrepaircost GP")[You do not have enough gold to repair your weapon.]](if: $gold >= $weaponrepaircost)[repair equipped weapon (link-replace: "$weaponrepaircost GP")[(set: $gold to it - $weaponrepaircost)(set: $weaponuse to $usemax)(replace: ?gold)[$gold]Your weapon is now fully repaired.]]
(link:"SELL")[(go-to:"sell")]
(link:"refresh")[(go-to:"shop")]
(if: $historyadj's last is "castle")[(link:"back")[(go-to:"F01")]](else:)[(link:"back")[(go-to: $historyadj's last)]]
to do:
* tweak xp gain stuff
things to add eventually:
* max weight for inventory
* more lessons
* more and better quests
** make quests encounters, get rid of quest board
* pet wolf
* actual alignment system
* more items (enchanted, buffs, etc)
** rings & necklaces-- a set number, like mb 2 or 3 of each
** variation in weapon/armor quality/worth
* more weapons
* shields maybe?
* more spells
** defensive spells maybe
* more types of monsters
* more more more (how do you like me)
{(if: $heal is "yes")[You heal yourself by (min:$levelheal,($hpmax - $hpcurr)) HP.(if: $hpcurr + $levelheal > $hpmax)[(set: $hpcurr to $hpmax)](else:)[(set: $hpcurr to $hpcurr + $levelheal)](set: $heal to "no")(replace: ?stats)[(display: "stats")]](else:)[]
(if: $manaheal is "yes")[You restore (min:$levelheal,($manamax - $manacurr)) MP.(if: $manacurr + $levelheal >= $manamax)[(set: $manacurr to $manamax)](else:)[(set: $manacurr to $manacurr + $levelheal)](set: $manaheal to "no")(replace: ?stats)[(display:"stats")]](else:)[]
(set: $plaInit to ((random:1,10) + 0.5*$luck + 2*$level + 0.5*$dex))(set: $aniInit to ((random:5,20) + $anilevel))
(if: $plaInit > $aniInit)[
(if: $spell is 0)[(set: $playerdmg to $weapondmg)]You attack the $animal with (if: $spell is 0)[(if: $weapon is 0)[your fists](else:)[your $weapon(set: $weaponuse to it - 1)]](else:)[$spell] for $playerdmg damage. (replace: ?stats)[(display:"stats")](set: $anihpcurr to it - $playerdmg)(if: $weaponuse is 0)[(if: $weapon is "bow")[(if: $arrowseq is 0)[You are out of arrows.]](if: $weapon is "your fists")[](else:)[Your $weapon breaks.(set: $weapon to "your fists")]]<br><br>
(set: $aniInit2 to (random: 1, 20))(if: $even2 contains $aniInit2)[The $animal attacks you for $anidmg damage.(set: $hpcurr to it - $anidmg)]
(if: $odd2 contains $aniInit2)[The $animal attempts to attack you, but misses.]
(if: $aniInit2 is 1)[The $animal attempts to attack you, but fumbles, hurting itself.(set: $anihpcurr to it - 2)]]
(elseif: $aniInit > $plaInit)[(set: $hpcurr to it - $anidmg)You miss. The $animal attacks you for $anidmg damage. (replace: ?stats)[(display:"stats")]]
(elseif: $aniInit is $plaInit)[You miss.
<br><br>
The $animal misses.]
}(if: $hpcurr <= 0)[
You have died.
(link:"new game")[(set: (saved-games:) to (saved-games:) - (a: "game"))(go-to:"title")]
{(if: (saved-games:) contains "game")[
(link: "load game")[(load-game:"game")]
]}](elseif: $hpcurr > 0)[
You have $hpcurr HP and $manacurr MP.
(if: $anihpcurr > 0)[
(if: $weapon is "bow")[(link-replace: "attack with $weapon")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $arrowseq to it - 1)(go-to:"animal")]](else:)[(link-replace: "attack with $weapon")[(set: $plaInit to 0)(set: $aniInit to 0)(go-to:"animal")]](if: $spells contains "fireball")[
(if: $manacurr >= $firecost)[(link-replace: "attack with fireball")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "fireball")(set: $playerdmg to $firedmg)(set: $manacurr to it - $firecost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "frostbite")[
(if: $manacurr >= $frostcost)[(link-replace: "attack with frostbite")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "frostbite")(set: $playerdmg to $frostdmg)(set: $manacurr to it - $frostcost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "lightning bolt")[
(if: $manacurr >= $lightcost)[(link-replace: "attack with lightning bolt")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "lightning bolt")(set: $playerdmg to $lightdmg)(set: $manacurr to it - $lightcost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "acid splash")[
(if: $manacurr >= $acidcost)[(link-replace: "attack with acid splash")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "acid splash")(set: $playerdmg to $aciddmg)(set: $manacurr to it - $acidcost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "earthquake")[
(if: $manacurr >= $earthcost)[(link-replace: "attack with earthquake")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "earthquake")(set: $playerdmg to $earthdmg)(set: $manacurr to it - $earthcost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "hail of thorns")[
(if: $manacurr >= $thornscost)[(link-replace: "attack with hail of thorns")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "hail of thorns")(set: $playerdmg to $thornsdmg)(set: $manacurr to it - $thornscost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $healspell is 1)[
(if: $manacurr >= $healcost)[(link-replace: "heal with spell")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $heal to "yes")(set: $manacurr to it - $healcost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $healthpotion's count >= 1)[
(link-replace: "heal with potion")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $heal to "yes")(set: $healthpotion's count to it - 1)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[](if: $manapotion's count >= 1)[
(link-replace: "restore mana")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $manaheal to "yes")(set: $manapotion's count to it - 1)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]
(link: "run away")[(go-to: $historyadj's last)]]
(elseif: $anihpcurr <= 0)[You have defeated the $animal!
(if: $weapon is "bow")[(set: $random2 to (random: 1, 20))(if: $even2 contains $random2)[You are able to retrieve an arrow.(set: $arrow's count to it + 1)]
(if: $random2 is 20)[You are able to retrieve two of your arrows.(set: $arrow's count to it + 2)]] You gain (if: $animalspoils is $D)[](else:)[(print: $animalspoils.join(", ")), ]$goldgainani GP and $xpgain XP. (set: $xpcurr to it + $xpgain)(set: $gold to it + $goldgainani)(if: $int is < 20)[(set: $xplevel to ($level*$level + 25))]
(else:)[(set: $xplevel to ($level*$level + 20))]
(set: $xpnext to ($xplevel - $xpcurr))(replace: ?stats)[(display: "stats")](if: $xpcurr >= $xplevel)[(set: $level to it + 1)(if: $int is < 20)[(set: $xplevel to ($level*$level + 25))]
(else:)[(set: $xplevel to ($level*$level + 20))]
(set: $xpnext to ($xplevel - $xpcurr))(replace: ?stats)[(display: "stats")]
You have gained a level!(set: $hpcurr to $hpmax)(set: $manacurr to $manamax)(set: $xpcurr to 0)]{(if: $animalspoils is $A)[(if: $animal is "rabbit")[(set: $rabbitpelt's count to it + 1)(set: $rabbitmeat's count to it + 1)](if: $animal is "wolf")[(set: $wolfpelt's count to it + 1)(set: $wolfmeat's count to it + 1)](set: $key's count to it + 1)]
(if: $animalspoils is $B)[(if: $animal is "rabbit")[(set: $rabbitpelt's count to it + 1)(set: $rabbitmeat's count to it + 1)](if: $animal is "wolf")[(set: $wolfpelt's count to it + 1)(set: $wolfmeat's count to it + 1)](set: $healthpotion's count to it + 1)]
(if: $animalspoils is $C)[(if: $animal is "rabbit")[(set: $rabbitpelt's count to it + 1)(set: $rabbitmeat's count to it + 1)](if: $animal is "wolf")[(set: $wolfpelt's count to it + 1)(set: $wolfmeat's count to it + 1)](set: $manapotion's count to it + 1)]
(if: $animalspoils is $J)[(set: $batwing's count to it + 1)(set: $bateye's count to it + 1)(set: $key's count to it + 1)]
(if: $animalspoils is $K)[(set: $batwing's count to it + 1)(set: $batwing's count to it + 1)(set: $healthpotion's count to it + 1)]
(if: $animalspoils is $L)[(set: $bateye's count to it + 1)(set: $bateye's count to it + 1)(set: $manapotion's count to it + 1)]
(if: $animalspoils is $X)[(set: $rattail's count to it + 1)]
}
(link: "continue")[(go-to: $historyadj's last)]]]
{
(set: $armorkind to (either: "Breastpiece", "Helm", "Gloves","Greaves","Boots"))
(set: $weapontype to "Sword")
(set: $sword to (datamap:"count", 1, "atk", 1, "acc", 1, "dur", 15, "price", 100, "sellprice", 70))
(set: $dagger to (datamap:"count", 0, "atk", 2, "acc", 1.25, "dur", 10, "price", 200, "sellprice", 140))
(set: $staff to (datamap:"count", 0, "atk", 1, "acc", 1, "dur", 20, "price", 100, "sellprice", 70))
(set: $axe to (datamap:"count", 0, "atk", 3, "acc", 0.8, "dur", 20, "price", 300, "sellprice", 210))
(set: $mace to (datamap:"count", 0, "atk", 3, "acc", 0.8, "dur", 15, "price", 300, "sellprice", 210))
(set: $bow to (datamap:"count", 0, "atk", 3, "acc", 0.4, "arrowseq", 0, "price", 100, "sellprice", 70))
(set: $arrow to (datamap: "count", 0, "price", 200))
(set: $fist to (datamap: "atk", 0.5, "acc", 0.25))
(set: $leathertunic to (datamap: "cost", 100, "armor", 1, "count", 1, "sellprice", 70))
(set: $leathercoif to (datamap: "cost", 100, "armor", 1, "count", 0, "sellprice", 70))
(set: $leatherglove to (datamap: "cost", 100, "armor", 1, "count", 0, "sellprice", 70))
(set: $leatherlegging to (datamap: "cost", 100, "armor", 1, "count", 1, "sellprice", 70))
(set: $leatherboot to (datamap: "cost", 100, "armor", 1, "count", 1, "sellprice", 70))
(set: $chainshirt to (datamap: "cost", 300, "armor", 3, "count", 0, "sellprice", 210))
(set: $chainboot to (datamap: "cost", 300, "armor", 3, "count", 0, "sellprice", 210))
(set: $chainpant to (datamap: "cost", 300, "armor", 3, "count", 0, "sellprice", 210))
(set: $chainglove to (datamap: "cost", 300, "armor", 3, "count", 0, "sellprice", 210))
(set: $chaincoif to (datamap: "cost", 300, "armor", 3, "count", 0, "sellprice", 210))
(set: $platebreastpiece to (datamap: "cost", 500, "armor", 5, "count", 0, "sellprice", 350))
(set: $plategreave to (datamap: "cost", 500, "armor", 5, "count", 0, "sellprice", 350))
(set: $plateboot to (datamap: "cost", 500, "armor", 5, "count", 0, "sellprice", 350))
(set: $plateglove to (datamap: "cost", 500, "armor", 5, "count", 0, "sellprice", 350))
(set: $platehelm to (datamap: "cost", 500, "armor", 5, "count", 0, "sellprice", 350))
(set: $healthpotion to (datamap: "count", 3, "price", 50))
(set: $manapotion to (datamap: "count", 3, "price", 50))
(set: $key to (datamap: "count", 2))
(set: $legendaryarmor to (datamap: "count", 0, "armor", 75))
(set: $legendaryweap to (datamap: "count", 0, "atk", 14, "dur", 100, "acc", 2))
(set: $rabbitpelt to (datamap: "count", 0, "sellprice", 25))
(set: $wolfpelt to (datamap: "count", 0, "sellprice", 25))
(set: $rabbitmeat to (datamap: "count", 0, "sellprice", 10))
(set: $goblinmeat to (datamap: "count", 0, "sellprice", 10))
(set: $wolfmeat to (datamap: "count", 0, "questcount", 0, "questgold", 500, "questxp", 100, "req", 10))
(set: $batwing to (datamap: "count", 0, "questcount", 0, "questgold", 500, "questxp",100, "req", 10))
(set: $bateye to (datamap: "count", 0, "questcount", 0, "questgold", 500, "questxp",100, "req", 10))
(set: $trollscalp to (datamap: "count", 0, "questcount", 0, "questgold", 500,"questxp",100, "req", 10))
(set: $goblinhand to (datamap: "count", 0, "questcount", 0, "questgold", 500,"questxp",100, "req", 10))
(set: $finger to (datamap: "count", 0, "questcount", 0, "questgold", 500, "questxp",100, "req", 10))
(set: $rattail to (datamap: "count", 0, "questcount", 0, "questgold", 500, "questxp",100, "req", 20))
(set: $beholdereye to (datamap: "count", 0, "questcount", 0, "questgold", 1000, "questxp", 200, "req", 1))
(set: $fireball to (datamap: "price", 50, "cost", 1, "dmg", 5))
(set: $frostbite to (datamap: "price", 75, "cost", 2, "dmg", 6))
(set: $lightningbolt to (datamap: "price", 100, "cost", 3, "dmg", 7))
(set: $acidsplash to (datamap: "price", 125, "cost", 5, "dmg", 8))
(set: $earthquake to (datamap: "price", 200, "cost", 7, "dmg", 10))
(set: $hailofthorn to (datamap: "price", 300, "cost", 9, "dmg", 15))
(set: $healspell to (datamap: "price", 50, "cost", 5))
(set: $makefire to (datamap: "price", 50, "cost", 2))
(set: $lesson to (datamap:"cost", 1000))
(set: $lessons to (a:))
(set: $alllessons to (a: "archery","tanning","cooking","swordfighting"))
(set: $gold to 200)
(set: $spells to (a:))
}
{(link:"save game")[
(if:(save-game:"game"))[
game saved
](else: )[
sorry, something went wrong
]
]}
{(if: $int is < 20)[(set: $xplevel to ($level*$level + 25))]
(else:)[(set: $xplevel to ($level*$level + 20))]
(set: $xpnext to ($xplevel - $xpcurr))
(if: $level*10 + $con < 20)[(set: $hpmax to 20)](else:)[(set: $hpmax to ($level*10 + $con))]
(if: $level*10 + $wis < 20)[(set: $manamax to 20)](else:)[(set: $manamax to ($level*10 + $wis))]
(set: $levelheal to $level*8)
(set: $xpgain to $monlevel*2 + (random:3,5))
(set: $xpgainani to (random:3,5) + (round: $anilevel*0.5))
(set: $goldgain to $monlevel*2 + (random:3,10))
(set: $goldgainani to (random:3,5))
(set: $treasure to $level*10 + (random:1,50))
(set: $finalreward to 1000000)
(set: $fireball's dmg to 5*$level)
(set: $frostbite's dmg to 6*$level)
(set: $lightningbolt's dmg to 7*$level)
(set: $acidsplash's dmg to 8*$level)
(set: $earthquake's dmg to 10*$level)
(set: $hailofthorn's dmg to 15*$level)
(set: $weapondmg to (ceil:((random:3,18) + 0.5*$str + $level + $atk + 0.1*$int + 0.1*$luck)))
(set: $mondmg to (max:0,(floor:((random:3,15) + $monlevel - $armor - 0.2*$luck))))
(set: $anidmg to (max:0,(floor:(random:4,8) + $anilevel - $armor - 0.2*$luck)))
(if: $weapon is "bow")[(set: $weaponuse to $bow's arrowseq)]
(if: $range contains $lawful)[(if: $range contains $good)[(set: $alignment to "true neutral")(if: $good > 2)[(set: $alignment to "neutral good")](if: $good < -2)[(set: $alignment to "neutral evil")]]]
(if: $lawful < -2)[(if: $range contains $good)[(set: $alignment to "chaotic neutral")(if: $good > 2)[(set: $alignment to "chaotic good")](if: $good < -2)[(set: $alignment to "chaotic evil")]]]
(if: $lawful > 2)[(if: $range contains $good)[(set: $alignment to "lawful neutral")(if: $good > 2)[(set: $alignment to "lawful good")](if: $good < -2)[(set: $alignment to "lawful evil")]]]
(set: $encounters to (a: "encounter","animal","dragon","forest wizard","guard", "troll","night","make camp","grue","beholder","group of rats","wolf","bat", "roll them bones","nothing", "treasure chest","spells encounter", "spells animal","spells dragon","goblin","rabbit", "legendary weapon", "legendary armor"))
(set: $historyadj to (history:) - (a: "inventory"))(set: $historyadj to $historyadj - (a: "shop"))(set: $historyadj to $historyadj - (a: "sell"))(set: $historyadj to $historyadj - (a: "town"))(set: $historyadj to $historyadj - (a: "quests"))(set: $historyadj to $historyadj - (a: "shop2"))(set: $historyadj to $historyadj - $encounters)
(set: $forest to (a: "forest1","forest2"))
(set: $dungeon to (a: "dungeon1","dungeon2"))
(if: $weapon is 0)[(set: $weapon to "your fists")]
(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)
}
|stats>[(set: $xpnext to $xplevel - $xpcurr)$name the level $level $race $class ($alignment)
$hpcurr / $hpmax HP, $manacurr / $manamax MP
$xpcurr XP ($xpnext XP to next level)]
|equippedweapon>[equipped: $weapon(if: $weapon is "your fists")[](else:)[(if: $weapon is "bow")[ and (text:$bow's arrowseq) arrows(link-replace:"^^[reload]^^")[(if: $bow's arrowseq is 10)[](else:)[(set: $arrow's count to it - (min: 10, (10 - $bow's arrowseq)))(set: $bow's arrowseq to 10)(go-to:"inventory")]] - $atk attack, (text: $acc*100) accuracy ](else:)[ - $weaponuse/$usemax durability, $atk attack, (text: $acc*100) accuracy](link-replace:"^^[unequip]^^")[(if: $weapon is "sword")[(set: $sword's count to it + 1)](if: $weapon is "bow")[(set: $bow's count to it + 1)(set: $arrow's count to it + $arrowseq)](if: $weapon is "staff")[(set: $staff's count to it + 1)](if: $weapon is "mace")[(set: $mace's count to it + 1)](if: $weapon is "axe")[(set: $axe's count to it + 1)](if: $weapon is "dagger")[(set: $dagger's count to it + 1)](set: $weapon to "your fists")(set: $acc to $fist's acc)(set: $atk to $fist's atk)(replace: ?equippedweapon)[equipped: $weapon](go-to: "inventory")]]]
|equippedarmor>[equipped armor - $armor armor:
|helm>[$helmtype(if: $helmtype is "no helm")[](else:)[(link-replace:"^^[unequip]^^")[(if $helmtype is "leather coif")[(set: $leathercoif's count to 1)](if: $helmtype is "chain coif")[(set: $chaincoif's count to it + 1)](if: $helmtype is "plate helm")[(set: $platehelm's count to it + 1)](set: $helmtype to "no helm")(replace: ?helm)[$helmtype]] - $helmarmor armor]|top>[
$toptype(if: $toptype is "no breastpiece")[](else:)[(link-replace:"^^[unequip]^^")[(if: $toptype is "leather tunic")[(set: $leathertunic's count to it + 1)](if: $toptype is "chain shirt")[(set: $chainshirt's count to it + 1)](if: $toptype is "plate breastpiece")[(set: $platebreastpiece's count to it + 1)](set: $toptype to "no breastpiece")(replace:?top)[$toptype]] - $toparmor armor]]|gloves>[
$glovestype(if: $glovestype is "no gloves")[](else:)[(link-replace:"^^[unequip]^^")[(if: $glovestype is "leather gloves")[(set: $leatherglove's count to it + 1)](if: $glovestype is "chain gloves")[(set: $chainglove's count to it + 1)](if: $glovestype is "plate gloves")[(set: $plateglove's count to it + 1)](set: $glovestype to "no gloves")(replace: ?gloves)[$glovestype]] - $glovesarmor armor]]|pants>[
$pantstype(if: $pantstype is "no greaves")[](else:)[(link-replace:"^^[unequip]^^")[(if: $pantstype is "leather leggings")[(set: $leatherlegging's count to it + 1)](if: $pantstype is "chain leggings")[(set: $chainlegging's count to it + 1)](if: $pantstype is "plate greaves")[(set: $plategreave's count to it + 1)](set: $pantstype to "no greaves")(replace: ?pants)[$pantstype]] - $pantsarmor armor]]|boots>[
$bootstype(if: $bootstype is "no boots")[](else:)[(link-replace:"^^[unequip]^^")[(if: $bootstype is "leather boots")[(set: $leatherboot's count to it + 1)](if: $bootstype is "chain boots")[(set: $chainboot's count to it + 1)](if: $bootstype is "plate boots")[(set: $plateboot's count to it + 1)](set: $bootstype to "no boots")(replace: ?boots)[$bootstype]] - $bootsarmor armor]]]
inventory:
$gold GP
a compass
a bedroll(if: $key's count >= 1)[
(if: $key's count is 1)[a key](else:)[(text: $key's count) keys]](if: $healthpotion's count >= 1)[
(if: $healthpotion's count is 1)[a health potion](else:)[(text: $healthpotion's count) health potions](link-replace:"^^[use]^^")[(set: $healthpotion's count to it - 1)(set: $hpcurr to (min: $hpmax, $hpcurr + $levelheal))(replace: ?stats)[(display: "stats")](go-to:"inventory")]](if: $manapotion's count >= 1)[
(if: $manapotion's count is 1)[a mana potion](else:)[(text: $manapotion's count) mana potions](link-replace:"^^[use]^^")[(set: $manapotion's count to it - 1)(set: $manacurr to (min: $manamax, $manacurr + $levelheal))(replace: ?stats)[(display: "stats")](go-to:"inventory")]](if: $sword's count >= 1)[
(if: $sword's count is 1)[a sword](else:)[(text: $sword's count) swords](if: $weapon is "sword")[ ''EQUIPPED''](else:)[(link-replace:"^^[equip]^^")[(if: $weapon is "sword")[(set: $sword's count to it + 1)](if: $weapon is "dagger")[(set: $dagger's count to it + 1)](if: $weapon is "staff")[(set: $staff's count to it + 1)](if: $weapon is "axe")[(set: $axe's count to it + 1)](if: $weapon is "mace")[(set: $mace's count to it + 1)](if: $weapon is "bow")[(set: $bow's count to it + 1)(set: $arrow's count to it + $bow's arrowseq)(set: $bow's arrowseq to 0)](set: $weapon to "sword")(set: $acc to $sword's acc)(set: $atk to $sword's atk)(set: $usemax to $sword's dur)(set: $weaponuse to $usemax)(set: $sword's count to it - 1)(replace: ?equippedweapon)[equipped: $weapon - $weaponuse/$usemax durability, $atk attack, (text: $acc*100) accuracy](go-to: "inventory")]] - (text: $sword's dur) durability, (text: $sword's acc*100) accuracy, (text: $sword's atk) attack ](if: $axe's count >= 1)[
(if: $axe's count is 1)[an axe](else:)[(text: $axe's count) axes](if: $weapon is "axe")[ ''EQUIPPED''](else:)[(link-replace:"^^[equip]^^")[(if: $weapon is "sword")[(set: $sword's count to it + 1)](if: $weapon is "dagger")[(set: $dagger's count to it + 1)](if: $weapon is "staff")[(set: $staff's count to it + 1)](if: $weapon is "axe")[(set: $axe's count to it + 1)](if: $weapon is "mace")[(set: $mace's count to it + 1)](if: $weapon is "bow")[(set: $bow's count to it + 1)(set: $arrow's count to it + $bow's arrowseq)(set: $bow's arrowseq to 0)](set: $weapon to "axe")(set: $acc to $axe's acc)(set: $atk to $axe's atk)(set: $usemax to $axe's dur)(set: $weaponuse to $usemax)(set: $axe's count to it - 1)(replace: ?equippedweapon)[equipped: $weapon - $weaponuse/$usemax durability, $atk attack, (text: $acc*100) accuracy](go-to: "inventory")]] - (text: $axe's dur) durability, (text: $axe's acc*100) accuracy, (text: $axe's atk) attack](if: $staff's count >= 1)[
(if: $staff's count is 1)[a staff](else:)[(text: $staff's count) staffs](if: $weapon is "staff")[ ''EQUIPPED''](else:)[(link-replace:"^^[equip]^^")[(if: $weapon is "sword")[(set: $sword's count to it + 1)](if: $weapon is "dagger")[(set: $dagger's count to it + 1)](if: $weapon is "staff")[(set: $staff's count to it + 1)](if: $weapon is "axe")[(set: $axe's count to it + 1)](if: $weapon is "mace")[(set: $mace's count to it + 1)](if: $weapon is "bow")[(set: $bow's count to it + 1)(set: $arrow's count to it + $bow's arrowseq)(set: $bow's arrowseq to 0)](set: $weapon to "staff")(set: $acc to $staff's acc)(set: $atk to $staff's atk)(set: $usemax to $staff's dur)(set: $weaponuse to $usemax)(set: $staff's count to it - 1)(replace: ?equippedweapon)[equipped: $weapon - $weaponuse/$usemax durability, $atk attack, (text: $acc*100) accuracy](go-to: "inventory")]] - (text: $staff's dur) durability, (text: $staff's acc*100) accuracy, (text: $staff's atk) attack ](if: $dagger's count >= 1)[
(if: $dagger's count is 1)[a dagger](else:)[(text: $dagger's count) daggers](if: $weapon is "dagger")[ ''EQUIPPED''](else:)[(link-replace:"^^[equip]^^")[(if: $weapon is "sword")[(set: $sword's count to it + 1)](if: $weapon is "staff")[(set: $staff's count to it + 1)](if: $weapon is "axe")[(set: $axe's count to it + 1)](if: $weapon is "mace")[(set: $mace's count to it + 1)](if: $weapon is "bow")[(set: $bow's count to it + 1)(set: $arrow's count to it + $bow's arrowseq)(set: $bow's arrowseq to 0)](set: $weapon to "dagger")(set: $acc to $dagger's acc)(set: $atk to $dagger's atk)(set: $usemax to $dagger's dur)(set: $weaponuse to $usemax)(set: $dagger's count to it - 1)(replace: ?equippedweapon)[equipped: $weapon - $weaponuse/$usemax durability, $atk attack, (text: $acc*100) accuracy](go-to: "inventory")]] - (text: $dagger's dur) durability, (text: $dagger's acc*100) accuracy, (text: $dagger's atk) attack ](if: $mace's count >= 1)[
(if: $mace's count is 1)[a mace](else:)[(text: $mace's count) maces](if: $weapon is "mace")[ ''EQUIPPED''](else:)[(link-replace:"^^[equip]^^")[(if: $weapon is "sword")[(set: $sword's count to it + 1)](if: $weapon is "staff")[(set: $staff's count to it + 1)](if: $weapon is "axe")[(set: $axe's count to it + 1)](if: $weapon is "mace")[(set: $mace's count to it + 1)](if: $weapon is "bow")[(set: $bow's count to it + 1)(set: $arrow's count to it + $bow's arrowseq)(set: $bow's arrowseq to 0)](if: $weapon is "dagger")[(set: $dagger's count to it + 1)](set: $weapon to "mace")(set: $acc to $mace's acc)(set: $atk to $mace's atk)(set: $usemax to $mace's dur)(set: $weaponuse to $usemax)(set: $mace's count to it - 1)(replace: ?equippedweapon)[equipped: $weapon - $weaponuse/$usemax durability, $atk attack, (text: $acc*100) accuracy](go-to: "inventory")]] - (text: $mace's dur) durability, (text: $mace's acc*100) accuracy, (text: $mace's atk) attack ](if: $bow's count >= 1)[
(if: $bow's count is 1)[a bow](else:)[(text: $bow's count) bows](if: $weapon is "bow")[ ''EQUIPPED'' (link-replace:"[reload]")[(if: $bow's arrowseq is 10)[(go-to:"inventory")](else:)[(set: $arrow's count to it - (min: 10, (10 - $bow's arrowseq)))(set: $bow's arrowseq to 10)(set: $weaponuse to $bow's arrowseq)(go-to:"inventory")]]](else:)[(link-replace:"^^[equip]^^")[(if: $weapon is "sword")[(set: $sword's count to it + 1)](if: $weapon is "staff")[(set: $staff's count to it + 1)](if: $weapon is "axe")[(set: $axe's count to it + 1)](if: $weapon is "mace")[(set: $mace's count to it + 1)](if: $weapon is "bow")[(set: $bow's count to it + 1)(set: $arrow's count to it + $bow's arrowseq)(set: $bow's arrowseq to 0)](if: $weapon is "dagger")[(set: $dagger's count to it + 1)](set: $weapon to "bow")(set: $acc to $bow's acc)(set: $atk to $bow's atk)(set: $bow's arrowseq to (min: 10, $arrow's count))(set: $bow's count to it - 1)(set: $arrow's count to it - $bow's arrowseq)(set: $weaponuse to $bow's arrowseq)(replace: ?equippedweapon)[equipped: $weapon and (text: $bow's arrowseq) arrows - $atk attack, (text: $acc*100) accuracy](go-to: "inventory")]] - (text: $bow's acc*100) accuracy, (text: $bow's atk) attack ](if: $arrow's count >= 1)[
(if: $arrow's count is 1)[an arrow](else:)[(text: $arrow's count) arrows]](if: $legendaryweapon's count is 1)[
$legendaryweapname - (text: $legendaryweapon's use) durability, (text: $legendaryweapon's atk) attack, (text: $legendaryweapon's acc* 100) accuracy(link-replace:"^^[equip]^^")[(if: $weapon is "sword")[(set: $sword's count to it + 1)](if: $weapon is "mace")[(set: $mace's count to it + 1)](if: $weapon is "dagger")[(set: $dagger's count to it + 1)](if: $weapon is "axe")[(set: $axe's count to it + 1)](if: $weapon is "staff")[(set: $staff's count to it + 1)](if: $weapon is "bow")[(set: $bow's count to it + 1)(set: $arrow's count to it + $bow's arrowseq)(set: $bow's arrowseq to 0)](set: $weapon to $legendweapname)(set: $legendaryweapon's count to it - 1)(set: $usemax to $legendaryweapon's use)(set: $weaponuse to $usemax)(set: $atk to $legendaryweapon's atk)(set: $acc to $legendaryweapon's acc)(replace: ?equippedweapon)[equipped: $weapon - $weaponuse/$usemax durability, $atk attack, (text: $acc*100) accuracy]
]]<!--helm follows-->(if: $leathercoif's count >= 1)[
(if: $leathercoif's count is 1)[a leather coif](else:)[(text: $leathercoif's count) leather coifs](link-replace:"^^[equip]^^")[(if: $helmtype is "leather coif")[(set: $leathercoif's count to it + 1)](if: $helmtype is "chain coif")[(set: $chaincoif's count to it + 1)](if: $helmtype is "plate helm")[(set: $platehelm's count to it + 1)](set: $helmtype to "leather coif")(set: $helmarmor to $leathercoif's armor)(set: $leathercoif's count to it - 1)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?helm)[$helmtype](go-to:"inventory")] -- (text: $leathercoif's armor) armor](if: $chaincoif's count >= 1)[
(if: $chaincoif's count is 1)[a chain coif](else:)[(text: $chaincoif's count) chain coifs](link-replace:"^^[equip]^^")[(if: $helmtype is "leather coif")[(set: $leathercoif's count to it + 1)](if: $helmtype is "chain coif")[(set: $chaincoif's count to it + 1)](if: $helmtype is "plate helm")[(set: $platehelm's count to it + 1)](set: $helmtype to "chain coif")(set: $helmarmor to $chaincoif's armor)(set: $chaincoif's count to it - 1)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?helm)[$helmtype](go-to:"inventory")] -- (text: $chaincoif's armor) armor](if: $platehelm's count >= 1)[
(if: $platehelm's count is 1)[a plate helm](else:)[(text: $platehelm's count) plate helms](link-replace:"^^[equip]^^")[(if: $helmtype is "leather coif")[(set: $leathercoif's count to it + 1)](if: $helmtype is "chain coif")[(set: $chaincoif's count to it + 1)](if: $helmtype is "plate helm")[(set: $platehelm's count to it + 1)](set: $helmtype to "plate helm")(set: $helmarmor to $platehelm's armor)(set: $platehelm's count to it - 1)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?helm)[$helmtype](go-to:"inventory")] -- (text: $platehelm's armor) armor]<!--breastpiece follows-->(if: $leathertunic's count >= 1)[
(if: $leathertunic's count is 1)[a leather tunic](else:)[(text: $leathertunic's count) leather tunics](link-replace: "^^[equip]^^")[(if: $toptype is "leather tunic")[(set: $leathertunic's count to it + 1)](if: $toptype is "chain shirt")[(set: $chainshirt's count to it + 1)](if: $toptype is "plate breastpiece")[(set: $platebreastpiece's count to it + 1)](set: $toptype to "leather tunic")(set: $leathertunic's count to it - 1)(set: $toparmor to $leathertunic's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?top)[$toptype](go-to:"inventory")] -- (text: $leathertunic's armor) armor](if: $chainshirt's count >= 1)[
(if: $chainshirt's count is 1)[a chain shirt](else:)[(text: $chainshirt's count) chain shirts](link-replace: "^^[equip]^^")[(if: $toptype is "leather tunic")[(set: $leathertunic's count to it + 1)](if: $toptype is "chain shirt")[(set: $chainshirt's count to it + 1)](if: $toptype is "plate breastpiece")[(set: $platebreastpiece's count to it + 1)](set: $shirttype to "chain shirt")(set: $chainshirt's count to it - 1)(set: $toparmor to $chainshirt's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?top)[$toptype](go-to:"inventory")] -- (text: $chainshirt's armor) armor](if: $platebreastpiece's count >= 1)[
(if: $platebreastpiece's count is 1)[a plate breastpiece](else:)[(text: $platebreastpiece's count) plate breastpieces](link-replace: "^^[equip]^^")[(if: $toptype is "leather tunic")[(set: $leathertunic's count to it + 1)](if: $toptype is "chain shirt")[(set: $chainshirt's count to it + 1)](if: $toptype is "plate breastpiece")[(set: $platebreastpiece's count to it + 1)](set: $toptype to "plate breastpiece")(set: $platebreastpiece's count to it - 1)(set: $toparmor to $platebreastpiece's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?top)[$toptype](go-to:"inventory")] -- (text: $platebreastpiece's armor) armor]<!--gloves follow-->(if: $leatherglove's count >= 1)[
(if: $leatherglove's count is 1)[a pair of leather gloves](else:)[(text: $leatherglove's count) pairs of leather gloves](link-replace:"^^[equip]^^")[(if: $glovestype is "leather gloves")[(set: $leatherglove's count to it + 1)](if: $glovestype is "chain gloves")[(set: $chainglove's count to it + 1)](if: $glovestype is "plate gloves")[(set: $plateglove's count to it + 1)](set: $glovestype to "leather gloves")(set: $leatherglove's count to it - 1)(set: $glovesarmor to $leatherglove's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?gloves)[$glovestype](go-to:"inventory")] -- (text: $leatherglove's armor) armor](if: $chainglove's count >= 1)[
(if: $chainglove's count is 1)[a pair of chain gloves](else:)[(text: $chainglove's count) pairs of chain gloves](link-replace:"^^[equip]^^")[(if: $glovestype is "leather gloves")[(set: $leatherglove's count to it + 1)](if: $glovestype is "chain gloves")[(set: $chainglove's count to it + 1)](if: $glovestype is "plate gloves")[(set: $plateglove's count to it + 1)](set: $glovestype to "chain gloves")(set: $chainglove's count to it - 1)(set: $glovesarmor to $chainglove's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?gloves)[$glovestype](go-to:"inventory")] -- (text: $chainglove's armor) armor](if: $plateglove's count >= 1)[
(if: $plateglove's count is 1)[a pair of plate gloves](else:)[(text: $plateglove's count) pairs of plate gloves](link-replace:"^^[equip]^^")[(if: $glovestype is "leather gloves")[(set: $leatherglove's count to it + 1)](if: $glovestype is "chain gloves")[(set: $chainglove's count to it + 1)](if: $glovestype is "plate gloves")[(set: $plateglove's count to it + 1)](set: $glovestype to "plate gloves")(set: $plateglove's count to it - 1)(set: $glovesarmor to $plateglove's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?gloves)[$glovestype](go-to:"inventory")] -- (text: $plateglove's armor) armor]<!--pants follow-->(if: $leatherlegging's count >= 1)[
(if: $leatherlegging's count is 1)[a pair of leather leggings](else:)[(text: $leatherlegging's count) pairs of leather leggings](link-replace:"^^[equip]^^")[(if: $pantstype is "leather leggings")[(set: $leatherlegging's count to it + 1)](if: $pantstype is "chain leggings")[(set: $chainlegging's count to it + 1)](if: $pantstype is "plate greaves")[(set: $plategreave's count to it + 1)](set: $pantstype to "leather leggings")(set: $leatherlegging's count to it - 1)(set: $pantsarmor to $leatherlegging's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?pants)[$pantstype](go-to:"inventory")] -- (text: $leatherlegging's armor) armor](if: $chainlegging's count >= 1)[
(if: $chainlegging's count is 1)[a pair of chain leggings](else:)[(text: $chainlegging's count) pairs of chain leggings](link-replace:"^^[equip]^^")[(if: $pantstype is "leather leggings")[(set: $leatherlegging's count to it + 1)](if: $pantstype is "chain leggings")[(set: $chainlegging's count to it + 1)](if: $pantstype is "plate greaves")[(set: $plategreave's count to it + 1)](set: $pantstype to "chain leggings")(set: $chainlegging's count to it - 1)(set: $pantsarmor to $chainlegging's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?pants)[$pantstype](go-to:"inventory")] -- (text: $chainlegging's armor) armor](if: $plategreave's count >= 1)[
(if: $plategreave's count is 1)[a pair of plate greaves](else:)[(text: $plategreave's count) pairs of plate greaves](link-replace:"^^[equip]^^")[(if: $pantstype is "leather leggings")[(set: $leatherlegging's count to it + 1)](if: $pantstype is "chain leggings")[(set: $chainlegging's count to it + 1)](if: $pantstype is "plate greaves")[(set: $plategreave's count to it + 1)](set: $pantstype to "plate greaves")(set: $plategreave's count to it - 1)(set: $pantsarmor to $plategreave's armor)
(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?pants)[$pantstype](go-to:"inventory")] -- (text: $plategreave's armor) armor]<!--boots follow-->(if: $leatherboot's count >= 1)[
(if: $leatherboot's count is 1)[a pair of leather boots](else:)[(text: $leatherboot's count) pairs of leather boots](link-replace: "^^[equip]^^")[(if: $bootstype is "leather boots")[(set: $leatherboot's count to it + 1)](if: $bootstype is "chain boots")[(set: $chainboot's count to it + 1)](if: $bootstype is "plate boots")[(set: $plateboot's count to it + 1)](set: $bootstype to "leather boots")(set: $leatherboot's count to it - 1)(set: $bootsarmor to $leatherboot's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?boots)[$bootstype](go-to:"inventory")] -- (text: $leatherboot's armor) armor](if: $chainboot's count >= 1)[
(if: $chainboot's count is 1)[a pair of chain boots](else:)[(text: $chainboot's count) pairs of chain boots](link-replace: "^^[equip]^^")[(if: $bootstype is "leather boots")[(set: $leatherboot's count to it + 1)](if: $bootstype is "chain boots")[(set: $chainboot's count to it + 1)](if: $bootstype is "plate boots")[(set: $plateboot's count to it + 1)](set: $bootstype to "chain boots")(set: $chainboot's count to it - 1)(set: $bootsarmor to $chainboot's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?boots)[$bootstype](go-to:"inventory")] -- (text: $chainboot's armor) armor](if: $plateboot's count >= 1)[
(if: $plateboot's count is 1)[a pair of plate boots](else:)[(text: $plateboot's count) pairs of plate boots](link-replace: "^^[equip]^^")[(if: $bootstype is "leather boots")[(set: $leatherboot's count to it + 1)](if: $bootstype is "chain boots")[(set: $chainboot's count to it + 1)](if: $bootstype is "plate boots")[(set: $plateboot's count to it + 1)](set: $bootstype to "plate boots")(set: $plateboot's count to it - 1)(set: $bootsarmor to $plateboot's armor)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](replace: ?boots)[$bootstype](go-to:"inventory")] -- (text: $plateboot's armor) armor](if: $legendaryarmor's count is 1)[
$legendaryarmorname(link-replace: "^^[equip]^^")[(if: $armorkind is "Helm")[(if: $helmtype is "leather coif")[(set: $leathercoif's count to it + 1)](if: $helmtype is "chain coif")[(set: $chaincoif's count to it + 1)](if: $helmtype is "plate helm")[(set: $platehelm's count to it + 1)](set: $helmtype to $legendaryarmorname)(set: $helmarmor to $legendaryarmor's armor)(replace: ?helm)[$helmtype]](if: $armorkind is "Breastpiece")[(if: $toptype is "leather tunic")[(set: $leathertunic's count to it + 1)](if: $toptype is "chain shirt")[(set: $chainshirt's count to it + 1)](if: $toptype is "plate breastpiece")[(set: $platebreastpiece's count to it + 1)](set: $toparmor to $legendaryarmor's armor)(set: $toptype to $legendaryarmorname)(replace: ?top)[$toptype]](if: $armorkind is "Gloves")[(if: $glovestype is "leather gloves")[(set: $leatherglove's count to it + 1)](if: $glovestype is "chain gloves")[(set: $chainglove's count to it + 1)](if: $glovestype is "plate gloves")[(set: $plateglove's count to it + 1)](set: $glovesarmor to $legendaryarmor's armor)(set: $glovestype to $legendaryarmorname)(replace: ?gloves)[$glovestype]](if: $armorkind is "Greaves")[(if: $pantstype is "leather leggings")[(set: $leatherlegging's count to it + 1)](if: $pantstype is "chain leggings")[(set: $chainlegging's count to it + 1)](if: $pantstype is "plate greaves")[(set: $plategreave's count to it + 1)](set: $pantsarmor to $legendaryarmor's armor)(set: $pantstype to $legendaryarmorname)(replace: ?pants)[$pantstype]](if: $armorkind is "Boots")[(if: $bootstype is "leather boots")[(set: $leatherboot's count to it + 1)](if: $bootstype is "chain boots")[(set: $chainboot's count to it + 1)](if: $bootstype is "plate boots")[(set: $plateboot's count to it + 1)](set: $bootsarmor to $legendaryarmor's armor)(set: $bootstype to $legendaryarmorname)(replace: ?boots)[$bootstype]](set: $legendaryarmor's count to it - 1)(set: $armor to $helmarmor + $toparmor + $glovesarmor + $pantsarmor + $bootsarmor)(replace: $armor)[$armor](go-to:"inventory")] -- (text: $legendaryarmor's armor) armor](if: $rabbitpelt's count >= 1)[
(if: $rabbitpelt's count is 1)[a rabbit pelt](else:)[(text: $rabbitpelt's count) rabbit pelts]]
(if: $rabbitmeat's count >= 1)[
(if: $rabbitmeat's count is 1)[a piece of rabbit meat](else:)[(text: $rabbitmeat's count) pieces of rabbit meat]](if: $wolfpelt's count >= 1)[
(if: $wolfpelt's count is 1)[a wolf pelt](else:)[(text: $wolfpelt's count) wolf pelts]](if: $wolfmeat's count >= 1)[
(if: $wolfmeat's count is 1)[a piece of wolf meat](else:)[(text: $wolfmeat's count) pieces of wolf meat]]
(if: $goblinmeat's count >= 1)[
(if: $goblinmeat's count is 1)[a piece of goblin meat](else:)[(text: $goblinmeat's count) pieces of goblin meat]](if: $goblinhand's count >= 1)[
(if: $goblinhand's count is 1)[a goblin hand](else:)[(text: $goblinhand's count) goblin hands]](if: $trollscalp's count >= 1)[
(if: $trollscalp's count is 1)[a troll scalp](else:)[(text: $trollscalp's count) troll scalps]]
(if: $finger's count >= 1)[
(if: $finger's count is 1)[a human finger](else:)[(text: $finger's count) human fingers]]
(if: $batwing's count >= 1)[
(if: $batwing's count is 1)[a bat wing](else:)[(text: $batwing's count) bat wings]]
(if: $bateye's count >= 1)[
(if: $bateye's count is 1)[a bat eye](else:)[(text: $bateye's count) bat eyes]](if: $beholdereye's count >= 1)[
(if: $beholdereye's count is 1)[a beholder eye](else:)[(text: $beholdereye's count) beholder eyes]]
(link:"refresh")[(go-to:"inventory")]
(if: $historyadj's last is "castle")[(link:"back")[(go-to:"F01")]](else:)[(link:"back")[(go-to: $historyadj's last)]]
(if: $princess is "yes")[(set: $gold to it + $finalreward)You all but drag the princess through the tall doors of the castle.
Queen Vivien looks shocked to see you, and maybe even a little disappointed, but covers her surprise and displeasure with a large, fake smile.
"Ah! $name! You've returned. At last my daughter is safe."
"Yes, Your Majesty."
Princess $princessname walks reluctantly to sit in the smaller throne to her mother's left.
"As agreed, here is the gold I promised you."
She hands you a small pouch containing $finalreward pieces of gold.
"Additionally, you are welcome now to stay in one of our lower rooms. Percival, would you show them to their chambers?"
The guard leads you down a long hallway and opens a door. It looks more like a dungeon than a bedroom.
"What--" you start, before he shoves you heavily into the room, closing and locking the door quickly.
It would seem you are not now in the queen's good favor after all.
(link:"new game")[(set: (saved-games:) to (saved-games:) - (a:"game"))(go-to: "title")]
{(if: (saved-games:) contains "game")[
(link: "load game")[(load-game:"game")]
]}
(link:"retry")[(go-to:"export startup")]
](else:)[Your journey begins, as many often do, in your home, situated within the walled city surrounding the castle.
You collect what you will need on your journey-- a sword, some armor, a few potions-- and prepare to enter the forest that separates you from the neighboring kingdom-- and the princess.
(link:"enter forest")[(set: $location to "forest1")(go-to: "F01")]]
Perfect! I knew you would (if: $lawful is 1)[be happy to ]help!
(if: $lawful is 1)[
Not only will you receive a large amount of gold, this is also the perfect opportunity to regain the queen's favor.
]
We believe the princess to be in the Kingdom Accalon, far to the northeast of us.
The journey there will be incredibly perilous, but the queen has the utmost faith in you, as do I.
Go forth, then, and rescue our dear princess!
(link:"begin your quest")[(set: $location to "forest1")(go-to:"castle")]
Made using (link:"Twine")[(goto-url:"http://twinery.org")]
Code and story by winona danger
Thumbnail image by Analie Foland
Theme music by Joshua Warneke
A thank you of course to everyone who has supported me in making games in any way, and a special thanks to those who helped test this game!
If you like this game, please consider pledging to me on Patreon (mine is located (link:"here")[(goto-url:"http://patreon.com/winonadanger")]) or sending a donation my way!
Thank you so much for playing!
[[back->title]]
You have |gold>[$gold] gold
(if: $axe's count >= 1)[(if: $axe's count is 1)[an axe ](else:)[(text: $axe's count) axes ](link-replace: "[sell one]")[(set: $var to $axe)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $axe to $var)(go-to:"sell")](if: $axe's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $axe)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $axe to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $axe)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $axe to $var)(go-to:"sell")]] - (text: $axe's sellprice) GP each](if: $bow's count >= 1)[
(if: $bow's count is 1)[a bow ](else:)[(text: $bow's count) bows ](link-replace: "[sell one]")[(set: $var to $bow)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $bow to $var)(go-to:"sell")](if: $bow's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $bow)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $bow to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $bow)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $bow to $var)(go-to:"sell")]] - (text: $bow's sellprice) GP each](if: $dagger's count >= 1)[
(if: $dagger's count is 1)[a dagger ](else:)[(text: $dagger's count) daggers ](link-replace: "[sell one]")[(set: $var to $dagger)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $dagger to $var)(go-to:"sell")](if: $dagger's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $dagger)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $dagger to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $dagger)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $dagger to $var)(go-to:"sell")]] - (text: $dagger's sellprice) GP each](if: $mace's count >= 1)[
(if: $mace's count is 1)[a mace ](else:)[(text: $mace's count) staffs ](link-replace: "[sell one]")[(set: $var to $mace)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $mace to $var)(go-to:"sell")](if: $mace's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $mace)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $mace to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $mace)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $mace to $var)(go-to:"sell")]] - (text: $mace's sellprice) GP each](if: $staff's count >= 1)[
(if: $staff's count is 1)[a staff ](else:)[(text: $staff's count) staffs ](link-replace: "[sell one]")[(set: $var to $staff)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $staff to $var)(go-to:"sell")](if: $staff's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $staff)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $staff to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $staff)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $staff to $var)(go-to:"sell")]] - (text: $staff's sellprice) GP each](if: $sword's count >= 1)[
(if: $sword's count is 1)[a sword ](else:)[(text: $sword's count) swords ](link-replace: "[sell one]")[(set: $var to $sword)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $sword to $var)(go-to:"sell")](if: $sword's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $sword)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $sword to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $sword)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $sword to $var)(go-to:"sell")]] - (text: $sword's sellprice) GP each](if: $leathercoif's count >= 1)[
(if: $leathercoif's count is 1)[a leather coif ](else:)[(text: $leathercoif's count) leather coifs ](link-replace: "[sell one]")[(set: $var to $leathercoif)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $leathercoif to $var)(go-to: "sell")](if: $leathercoif's count >= 2)[ (link-replace:"[sell all but one]")[(set: $var to $leathercoif)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $leathercoif to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $leathercoif)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $leathercoif to $var)(go-to: $sell)]] - (text: $leathercoif's sellprice) GP each.](if: $chaincoif's count >= 1)[
(if: $chaincoif's count is 1)[a chain coif ](else:)[(text: $chaincoif's count) chain coifs ](link-replace: "[sell one]")[(set: $var to $chaincoif)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $chaincoif to $var)(go-to: "sell")](if: $chaincoif's count >= 2)[ (link-replace:"[sell all but one]")[(set: $var to $chaincoif)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $chaincoif to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $chaincoif)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $chaincoif to $var)(go-to: $sell)]] - (text: $chaincoif's sellprice) GP each.](if: $platehelm's count >= 1)[
(if: $platehelm's count is 1)[a plate helm ](else:)[(text: $platehelm's count) plate helms ](link-replace: "[sell one]")[(set: $var to $platehelm)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $platehelm to $var)(go-to: "sell")](if: $platehelm's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $platehelm)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $platehelm to $var)(go-to: "sell")] (link-replace: "[sell all]")[(set: $var to $platehelm)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $platehelm to $var)(go-to:"sell")]] - (text: $platehelm's sellprice) GP each](if: $leathertunic's count >= 1)[
(if: $leathertunic's count is 1)[a leather tunic ](else:)[(text: $leathertunic's count) leather tunics ](link-replace: "[sell one]")[(set: $var to $leathertunic)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $leathertunic to $var)(go-to: "sell")](if: $leathertunic's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $leathertunic)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $leathertunic to $var)(go-to: "sell")] (link-replace: "[sell all]")[(set: $var to $leathertunic)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $leathertunic to $var)(go-to:"sell")]] - (text: $leathertunic's sellprice) GP each](if: $chainshirt's count >= 1)[
(if: $chainshirt's count is 1)[a chain shirt ](else:)[(text: $chainshirt's count) chain shirts ](link-replace: "[sell one]")[(set: $var to $chainshirt)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $chainshirt to $var)(go-to: "sell")](if: $chainshirt's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $chainshirt)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $chainshirt to $var)(go-to: "sell")] (link-replace: "[sell all]")[(set: $var to $chainshirt)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $chainshirt to $var)(go-to:"sell")]] - (text: $chainshirt's sellprice) GP each](if: $platebreastpiece's count >= 1)[
(if: $platebreastpiece's count is 1)[a plate breastpiece ](else:)[(text: $platebreastpiece's count) plate breastpieces ](link-replace: "[sell one]")[(set: $var to $platebreastpiece)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $platebreastpiece to $var)(go-to: "sell")](if: $platebreastpiece's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $platebreastpiece)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $platebreastpiece to $var)(go-to: "sell")] (link-replace: "[sell all]")[(set: $var to $platebreastpiece)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $platebreastpiece to $var)(go-to:"sell")]] - (text: $platebreastpiece's sellprice) GP each](if: $leatherglove's count >= 1)[
(if: $leatherglove's count is 1)[a pair of leather gloves ](else:)[(text: $leatherglove's count) pairs of leather gloves ](link-replace: "[sell one]")[(set: $var to $leatherglove)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $leatherglove to $var)(go-to: "sell")](if: $leatherglove's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $leatherglove)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $leatherglove to $var)(go-to: "sell")] (link-replace: "[sell all]")[(set: $var to $leatherglove)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $leatherglove to $var)(go-to:"sell")]] - (text: $leatherglove's sellprice) GP each](if: $chainglove's count >= 1)[
(if: $chainglove's count is 1)[a pair of chain gloves ](else:)[(text: $chainglove's count) pairs of chain gloves ](link-replace: "[sell one]")[(set: $var to $chainglove)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $chainglove to $var)(go-to: "sell")](if: $chainglove's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $chainglove)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $chainglove to $var)(go-to: "sell")] (link-replace: "[sell all]")[(set: $var to $chainglove)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $chainglove to $var)(go-to:"sell")]] - (text: $chainglove's sellprice) GP each](if: $plateglove's count >= 1)[
(if: $plateglove's count is 1)[a pair of plate gloves ](else:)[(text: $plateglove's count) pairs of plate gloves ](link-replace: "[sell one]")[(set: $var to $plateglove)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $plateglove to $var)(go-to: "sell")](if: $plateglove's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $plateglove)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 1)(set: $plateglove to $var)(go-to: "sell")] (link-replace: "[sell all]")[(set: $var to $plateglove)(set: $gold to it + $var's sellprice * $var's count)(set: $var's count to 0)(set: $plateglove to $var)(go-to:"sell")]] - (text: $plateglove's sellprice) GP each](if: $leatherlegging's count >= 1)[
(if: $leatherlegging's count is 1)[a pair of leather leggings ](else:)[(text: $leatherlegging's count) pairs of leather leggings ](link-replace: "[sell one]")[(set: $var to $leatherlegging)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $leatherlegging to $var)(go-to:"sell")](if: $leatherlegging's cound >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $leatherlegging)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $leatherlegging to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $leatherlegging)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $leatherlegging to $var)(go-to:"sell")]] - (text: $leatherlegging's sellprice) GP each](if: $chainlegging's count >= 1)[
(if: $chainlegging's count is 1)[a pair of chain leggings ](else:)[(text: $chainlegging's count) pairs of chain leggings ](link-replace: "[sell one]")[(set: $var to $chainlegging)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $chainlegging to $var)(go-to:"sell")](if: $chainlegging's cound >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $chainlegging)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $chainlegging to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $chainlegging)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $chainlegging to $var)(go-to:"sell")]] - (text: $chainlegging's sellprice) GP each](if: $plategreave's count >= 1)[
(if: $plategreave's count is 1)[a pair of plate greaves ](else:)[(text: $plategreave's count) pairs of plate greaves ](link-replace: "[sell one]")[(set: $var to $plategreave)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $plategreave to $var)(go-to:"sell")](if: $plategreave's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $plategreave)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $plategreave to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $plategreave)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $plategreave to $var)(go-to:"sell")]] - (text: $plategreave's sellprice) GP each](if: $leatherboot's count >= 1)[
(if: $leatherboot's count is 1)[a pair of leather boots ](else:)[(text: $leatherboot's count) pairs of leather boots ](link-replace: "[sell one]")[(set: $var to $leatherboot)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $leatherboot to $var)(go-to:"sell")](if: $leatherboot's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $leatherboot)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $leatherboot to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $leatherboot)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $leatherboot to $var)(go-to:"sell")]] - (text: $leatherboot's sellprice) GP each](if: $chainboot's count >= 1)[
(if: $chainboot's count is 1)[a pair of chain boots ](else:)[(text: $chainboot's count) pairs of chain boots ](link-replace: "[sell one]")[(set: $var to $chainboot)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $chainboot to $var)(go-to:"sell")](if: $chainboot's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $chainboot)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $chainboot to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $chainboot)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $chainboot to $var)(go-to:"sell")]] - (text: $chainboot's sellprice) GP each](if: $plateboot's count >= 1)[
(if: $plateboot's count is 1)[a pair of plate boots ](else:)[(text: $plateboot's count) pairs of plate boots ](link-replace: "[sell one]")[(set: $var to $plateboot)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $plateboot to $var)(go-to:"sell")](if: $plateboot's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $plateboot)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $plateboot to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $plateboot)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $plateboot to $var)(go-to:"sell")]] - (text: $plateboot's sellprice) GP each](if: $rabbitmeat's count >= 1)[
(if: $rabbitmeat's count is 1)[a piece of rabbit meat ](else:)[(text: $rabbitmeat's count) pieces of rabbit meat ](link-replace: "[sell one]")[(set: $var to $rabbitmeat)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $rabbitmeat to $var)(go-to:"sell")](if: $rabbitmeat's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $rabbitmeat)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $rabbitmeat to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $rabbitmeat)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $rabbitmeat to $var)(go-to:"sell")]] - (text: $rabbitmeat's sellprice) GP each](if: $rabbitpelt's count >= 1)[
(if: $rabbitpelt's count is 1)[a rabbit pelt ](else:)[(text: $rabbitpelt's count) rabbit pelts ](link-replace: "[sell one]")[(set: $var to $rabbitpelt)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $rabbitpelt to $var)(go-to:"sell")](if: $rabbitpelt's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $rabbitpelt)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $rabbitpelt to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $rabbitpelt)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $rabbitpelt to $var)(go-to:"sell")]] - (text: $rabbitpelt's sellprice) GP each](if: $wolfpelt's count >= 1)[
(if: $wolfpelt's count is 1)[a wolf pelt ](else:)[(text: $wolfpelt's count) wolf pelts ](link-replace: "[sell one]")[(set: $var to $wolfpelt)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $wolfpelt to $var)(go-to:"sell")](if: $wolfpelt's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $wolfpelt)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $wolfpelt to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $wolfpelt)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $wolfpelt to $var)(go-to:"sell")]] - (text: $wolfpelt's sellprice) GP each](if: $goblinmeat's count >= 1)[
(if: $goblinmeat's count is 1)[a piece of goblin meat ](else:)[(text: $goblinmeat's count) pieces of goblin meat ](link-replace: "[sell one]")[(set: $var to $goblinmeat)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice)(set: $goblinmeat to $var)(go-to:"sell")](if: $goblinmeat's count >= 2)[ (link-replace: "[sell all but one]")[(set: $var to $goblinmeat)(set: $var's count to it - 1)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 1)(set: $goblinmeat to $var)(go-to:"sell")] (link-replace: "[sell all]")[(set: $var to $goblinmeat)(set: $gold to it + $var's sellprice*$var's count)(set: $var's count to 0)(set: $goblinmeat to $var)(go-to:"sell")]] - (text: $goblinmeat's sellprice) GP each]
(link:"back")[(go-to:(history:)'s last)]
It is getting to be very dark. You might want to think about making camp.
(link:"make camp")[(set: $turn to 0)(go-to:"make camp")]
(link:"go east")[(set: $turn to 0)(go-to:"grue")]
(link: "go west")[(set: $turn to 0)(go-to:"grue")]
(link: "go north")[(set: $turn to 0)(go-to:"grue")]
(link: "go south")[(set: $turn to 0)(go-to:"grue")]
You head out into the dark forest.
You are eaten by a grue.
(link:"play again")[(set: (saved-games:) to (saved-games:) - (a: "game"))(go-to: "title")]
{(if: (saved-games:) contains "game")[
(link: "load game")[(load-game:"game")]
]}
You set up camp.
(if: $spells contains "make fire")[(if: $manacurr >= $makefirecost)[(link-replace:"make a fire")[You make a fire using the spell "make fire."(set:$manacurr to it - $makefirecost)(set: $fire to "yes")(replace: ?stats)[(display:"stats")]]]](else:)[
(set: $hpcurr to it - 2)(replace: ?stats)[(display:"stats")]You wish could make a fire. It's really cold.(set: $cold to 1)]
You're kind of hungry after a long day travelling.
(if: $rabbitmeat's count >= 1)[Thankfully, you have some rabbit meat!
(if: $fire is "yes")[(link: "cook up some rabbit meat!")[(set: $hpcurr to (min: $hpmax,($hpcurr+4)))(replace: ?stats)[(display: "stats")]You cook up and eat a piece of the rabbit meat. Yum! You feel more energized.(set: $rabbitmeat's count to it - 1)](else:)[(link: "eat some raw rabbit meat!")[(set: $hpcurr to $hpcurr - 2)(replace: ?stats)[(display: "stats")]You eat some of the rabbit meat, raw and slick and cold. Disgusting. You don't feel so good...(set: $rabbitmeat's count to it - 1)(set: $xpcurr to it + 5)]]]]
(if: $goblinmeat's count >= 1)[(if: $rabbitmeat's count is 0)[Thankfully, you have some goblin meat!
(link:"eat some goblin meat")[You eat some. You don't feel so good... (set: $hpcurr to (max:0, $hpcurr - 4))(set: $xpcurr to it + 5)(set: $goblinmeat's count to it - 1)(replace:?stats)[(display:"stats")]]
(link:"pass on the goblin meat")[You decide, probably wisely, not to eat the goblin meat. You're pretty hungry, though... (set: $hpcurr to it - 2)(set: $hungry to 1)(replace:?stats)[(display: "stats")]](else:)[You also have some goblin meat!
(link:"eat some goblin meat")[You eat some. You don't feel so good... (set: $hpcurr to (max:0, $hpcurr - 4))(set: $goblinmeat's count to it - 1)(set: $xpcurr to it + 5)(replace: ?stats)[(display: "stats")]
(link:"pass on the goblin meat")[You decide, probably wisely, not to eat the goblin meat. You're pretty hungry thought...(set: $hpcurr to it - 2)(set: $hungry to 1)(replace: ?stats)[(display: "stats")]]]]]]
(else:)[You really wish you had something to eat.(set: $hpcurr to it - 2)(set: $hungry to 1)(replace: ?stats)[(display:"stats")]]
You sleep (if: $hungry + $cold is 0)[peacefully](else:)[restlessly] through the night, and wake up (if: $hungry + $cold is 0)[refreshed and ](else:)[reluctantly ]ready for another day.
(link: "onward, to victory!")[(go-to: $historyadj's last)]
(set: $encounter to (round:(random: 1,20)+0.2*$luck))(if: $forest contains $location)[You hear a rustling in the leaves.](if: $dungeon contains $location)[You hear a dull thud.]
{(if: $dungeon contains $location)[(if: $even contains "encounter")[(link:"investigate")[(go-to: (either:"guard","bat","group of rats","treasure chest","goblin","troll","beholder"))]]](elseif: $forest contains $location)[(if: $even contains $encounter)[(link:"investigate")[(go-to: (either:"goblin","troll","wolf","bat","group of rats","rabbit","treasure chest"))]]](if: $odd contains $encounter)[(link:"investigate")[(go-to: "nothing")]](if: $encounter >= 20)[(link:"investigate")[(if: $legendaryarmor is 0)[(go-to: (either:"treasure chest","legendary armor"))](if: $legendaryweapon is 0)[(go-to: (either:"treasure chest","legendary weapon"))](if: $legendaryarmor + $legendaryweapon is 2)[(go-to: "treasure chest")]]](if: $encounter is 1)[(link:"investigate")[(go-to:"beholder")]]}
You investigate the noise, but it must have just been your imagination.
(link:"continue")[(set: $xpcurr to it + 5)(go-to: $historyadj's last)]
(set: $monster to "dragon")(set: $monlevel to 25)(set: $dragonhpmax to 1000)(set: $monhp to $dragonhpmax)(set: $dragondmg to (random: 10, 100))(set: $xpgaindragon to $xpgain + 200)You open the door in front of you.
It opens into a spacious room, taken up almost entirely by a large, sleeping dragon.
Behind it is another door, which you assume leads to the room where Princess $princessname is being kept (as well as some dragon treasure, you hope).
The dragon doesn't notice you, of course, and there's still time to get out if you're not quite ready for this fight.
(link:"go back")[(set: $location to "dungeon2")(go-to:"F13")]
(link:"attack with $weapon")[(go-to:"dragon")]
(display:"spells dragon")
(if: (history:)'s last is "forest wizard")[](else:)[You walk up to the cottage and knock on the door softly.
It seems like no one is home, and you reach for the knob, when you hear a loud ''POP'' behind you.
You turn and see a very tall man, smoke wisping around his ankles.
"Hello hello and welcome welcome to my forest, $name," the man booms.
You're a little shocked that he knows your name, but you're also a little shocked that he just suddenly appeared behind you so one thing at a time.
"Who are you?" you ask, finally.
"I am $wizardname and I can make you smarter, wiser, more charming, stronger, hardier, luckier, nimbler than you can even imagine! Or not. It's all up to chance."
He notes your intrigued expression and adds, "For a small fee, of course."
(if: $gold > 0)[
CHA: $cha (link-replace: "reroll")[(if: $race is "fairy")[(if: $class is "rogue")[(set: $cha to (round: (random: 10, 25)+ 0.1*$luck))](else:)[(set: $cha to (round:(random: 10, 20)+ ).1*$luck))]](elseif: $race is "orc")[(set: $cha to (round:(random: 5, 10)+ 0.1*$luck))](elseif: $race is "dwarf")[(set: $cha to (round:(random: 5, 10)+ 0.1*$luck))](elseif: $race is "fairy")[(set: $cha to (round:(random: 10, 20)+ 0.1*$luck))](else:)[(set: $cha to (round:(random: 5, 15)+0.1*$luck))] -- $cha(set: $gold to 0)]
INT: $int (link-replace: "reroll")[(if: $race is "orc")[(set: $int to (round:(random 5, 15)+ 0.1*$luck))](else:)[(set: $int to (round:(random: 5, 20)+0.1*$luck))] -- $int(set: $gold to 0)]
STR: $str (link-replace: "reroll")[(if: $class is "barbarian")[(if: $race is "orc")[(set: $str to (round:(random: 15, 25)+0.1*$luck))](else:)[(set: $str to (round:(random: 10, 20)+0.1*$luck))]](else:)[(if: $race is "orc")[(set: $str to (round:(random: 10, 20)+0.1*$luck))]](else:)[(set: $str to (round:(random: 5, 15)+ 0.1*$luck))] -- $str(set: $gold to 0)]
DEX: $dex (link-replace: "reroll")[(if: $class is "rogue")[(if: $race is "dwarf")[(set: $dex to (round:(random: 5, 15)+ 0.1*$luck))](elseif: $race is "orc")[(set: $dex to (round:(random: 5, 15)+0.1*$luck))](else:)[(set: $dex to (round:(random: 10, 20)+0.1*$luck))]](else:)[(set: $dex to (round:(random: 5, 15)+0.1*$luck))] -- $dex(set: $gold to 0)]
CON: $con (link-replace: "reroll")[(if: $class is "ranger")[(if: $race is "dwarf")[(set: $con to (round:(random: 15, 25)+0.1*$luck))](else:)[(set: $con to (round:(random: 10, 20)+0.1*$luck))]](else:)[(if: $race is "dwarf")[(set: $con to (round:(random: 10, 20)+0.1*$luck))]](else:)[(set: $con to (round:(random: 5, 15))+0.1*$luck)] -- $con(set: $gold to 0)]
WIS: $wis (link-replace: "reroll")[(if: $class is "mage")[(if: $race is "elf")[(set: $wis to (round:(random: 15, 25)+0.1*$luck))](else:)[(set: $wis to (round:(random: 10, 20)+0.1*$luck))]](elseif: $class is "cleric")[(if: $race is "elf")[(set: $wis to (round:(random: 10, 25)+0.1*$luck))](else:)[(set: $wis to (round:(random: 10, 20)+0.1*$luck))]](else:)[(set: $wis to (round:(random: 5, 15)+0.1*$luck))] -- $wis(set: $gold to 0)]
LUCK: $luck (link-replace: "reroll")[(if: $class is "cleric")[(if: $race is "human")[(set: $luck to (round:0.1*$luck + (random: 15, 25)))](else:)[(set: $luck to (round: 0.1*$luck + (random: 10, 20)))]](else:)[(if: $race is "human")[(set: $luck to (round: 0.1*$luck + (random: 10, 20)))](else:)[(set: $luck to (round: 0.1*$luck + (random: 5, 15)))]] -- $luck(set: $gold to 0)]
(link:"confirm")[(go-to:"forest wizard")]]]
{(if: $gold is 0)[(if: (history:)'s last is "forest wizard")[<br><br>You ask what the fee is, but you soon see that you are talking to air.
<br><br>
Your pockets feel lighter.
<br><br>
There's nothing more for you here.]
(else:)[You can't afford any fees he may have.]]}
(link:"back")[(go-to: $historyadj's last)]
{(set: $monster to "guard")(set: $monlevel to $level + (random:1,3))(set: $monhpmax to ($monlevel*7) + 10)(set: $monhpcurr to $monhpmax)
(set: $monsterspoils to (either: $T, $U, $V, $W, $D))}
(if: $gold > 200)[(set: $gold to it - 200)You hand over 200 GP and watch the guard's eyes go wide.
He steps aside from the door and pretends he hasn't seen you.
(link:"enter dungeon")[(go-to:"F01")]](else:)[You hand over a bribe of $gold gold, but the guard doesn't seem too impressed.(set: $gold to 0)
(link:"fight the guard")[(go-to:"guard")]
(link:"leave")[(set: $location to "forest2")(go-to:"F13")]]
(if: $spells contains "fireball")[
(if: $manacurr >= $fireball's cost)[(link-replace: "attack with fireball")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "fireball")(set: $playerdmg to $fireball's dmg)(set: $manacurr to it - $fireball's cost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "frostbite")[
(if: $manacurr >= $frostbite's cost)[(link-replace: "attack with frostbite")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "frostbite")(set: $playerdmg to $frostbite's dmg)(set: $manacurr to it - $frostbite's cost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "lightning bolt")[
(if: $manacurr >= $lightningbolt's cost)[(link-replace: "attack with lightning bolt")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "lightning bolt")(set: $playerdmg to $lightningbolt's dmg)(set: $manacurr to it - $lightningbolt's cost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "acid splash")[
(if: $manacurr >= $acidsplash's cost)[(link-replace: "attack with acid splash")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "acid splash")(set: $playerdmg to $acidsplash's dmg)(set: $manacurr to it - $acidsplash's cost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "earthquake")[
(if: $manacurr >= $earthquake's cost)[(link-replace: "attack with earthquake")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "earthquake")(set: $playerdmg to $earthquake's dmg)(set: $manacurr to it - $earthquake's cost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[](if: $spells contains "hail of thorns")[
(if: $manacurr >= $hailofthorn's cost)[(link-replace: "attack with hail of thorns")[(set: $plaInit to 0)(set: $aniInit to 0)(set: $spell to "hail of thorns")(set: $playerdmg to $hailofthorn's dmg)(set: $manacurr to it - $hailofthorn's cost)(replace: ?stats)[(display:"stats")](go-to:"animal")]](else:)[]](else:)[]
(if: $spells contains "fireball")[
(if: $manacurr >= $fireball's cost)[(link-replace: "attack with fireball")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "fireball")(set: $playerdmg to $fireball's dmg)(set: $manacurr to it - $fireball's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "frostbite")[
(if: $manacurr >= $frostbite's cost)[(link-replace: "attack with frostbite")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "frostbite")(set: $playerdmg to $frostbite's dmg)(set: $manacurr to it - $frostbite's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "lightning bolt")[
(if: $manacurr >= $lightningbolt's cost)[(link-replace: "attack with lightning bolt")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "lightning bolt")(set: $playerdmg to $lightningbolt's dmg)(set: $manacurr to it - $lightningbolt's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "acid splash")[
(if: $manacurr >= $acidsplash's cost)[(link-replace: "attack with acid splash")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "acid splash")(set: $playerdmg to $acidsplash's dmg)(set: $manacurr to it - $acidsplash's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "earthquake")[
(if: $manacurr >= $earthquake's cost)[(link-replace: "attack with earthquake")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "earthquake")(set: $playerdmg to $earthquake's dmg)(set: $manacurr to it - $earthquake's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[](if: $spells contains "hail of thorns")[
(if: $manacurr >= $hailofthorn's cost)[(link-replace: "attack with hail of thorns")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "hail of thorns")(set: $playerdmg to $hailofthorn's dmg)(set: $manacurr to it - $hailofthorn's cost)(replace: ?stats)[(display:"stats")](go-to:"encounter")]](else:)[]](else:)[]
(if: $lessons contains "archery")[](else:)[(link-replace:"archery - (text: $lesson's cost) GP")[(if: $gold < $lesson's cost)[You do not have enough gold for this lesson.](else:)[(if: $class is "ranger")[(set: $bow's acc to 2)](else:)[(set: $bow's acc to 1.25)](set: $gold to it - $lesson's cost)(set: $dex to it + 1)(set: $lessons to it + (a: "archery"))You have learned archery.]]](if: $lessons contains "swordfighting")[](else:)[(link-replace:"swordfighting - (text: $lesson's cost) GP")[(if: $gold < $lesson's cost GP)[You do not have enough gold for this lesson.](else:)[(set: $sword's atk to 3)(set: $str to it + 1)(set: $con to it + 1)(set: $gold to it - $lesson's cost)(set: $lessons to it + (a: "swordfighting"))You have learned swordfighting.]]](if: $lessons contains "cooking")[](else:)[
(link-replace:"cooking - (text: $lesson's cost) GP")[(if: $gold < $lesson's cost)[You do not have enough gold for this lesson.](else:)[(if: $spells contains "make fire")[](else:)[(set: $spells to $spells + (a: "make fire"))](set: $con to it + 1)(set: $int to it + 1)(set: $gold to it - $lesson's cost)(set: $lessons to it + (a: "cooking"))You have learned cooking.]]](if: $lessons contains "tanning")[](else:)[
(link-replace:"tanning - (text: $lesson's cost) GP")[(if: $gold < $lesson's cost)[You do not have enough gold for this lesson.](else:)[(set: $rabbitpelt's sellprice to 50)(set: $wolfpelt's sellprice to 50)(set: $int to it + 1)(set: $lessons to it + (a: "tanning"))You have learned tanning.]]](if: $lessons contains $alllessons)[You have learned all we have to teach you.]
{(set: $heavy to (either:"plate helm","plate boots","plate breastpiece","plate greaves", "plate gloves"))
(set: $light to (either:"leather coif", "leather boots","leather tunic", "leather leggings", "leather gloves"))
(set: $medium to (either: "chain coif","chain boots","chain shirt","chain leggings","chain gloves"))
(set: $A to (a:"a pelt", "a piece of meat", "a key"))
(set: $B to (a: "a pelt", "a piece of meat", "a health potion"))
(set: $C to (a: "a pelt", "a piece of meat", "a mana potion"))
(set: $D to (a:))
(set: $E to (a:"goblin meat", "goblin hand", "a mana potion", "a health potion"))
(set: $F to (a: "goblin meat", "goblin hand", "a key", "light armor"))
(set: $G to (a: "goblin meat", "goblin hand", "a sword", "a key"))
(set: $H to (a: "goblin meat", "goblin hand"))
(set: $J to (a:"a bat wing", "a bat eye", "a key"))
(set: $K to (a:"a bat wing", "a bat wing", "a health potion"))
(set: $L to (a:"a bat eye", "a bat eye", "a mana potion"))
(set: $P to (a:"a troll scalp", "a mace", "a key", "a health potion"))
(set: $Q to (a:"a troll scalp", "an axe", "a key", "a mana potion"))
(set: $R to (a:"a troll scalp", $heavy, "a key"))
(set: $S to (a:"a troll scalp", "a key"))
(set: $T to (a:"a human finger", "a keyring"))
(set: $U to (a:"a human finger", "a mace", "a key"))
(set: $V to (a:"a human finger", $light, "a key"))
(set: $W to (a:"a human finger", "an axe"))
(set: $X to (a: "a rat tail", "a rat tail"))
(set: $Y to (a: "a beholder eye"))
}
You are in a small town-- you had no idea this place was even here!
There is a large board in the town center with postings on it, and a small shop off to one side.
It gives you the impression it's still growing.
(link-reveal:"investigate board")[(go-to:"quests")]
[[shop->shop2]]
(link: "leave")[(go-to: $historyadj's last)]
You have |gold>[$gold] GP.
(set: $allspells to (a: "fireball", "frostbite", "lightning bolt", "hail of thorns", "acid splash", "earthquake", "heal", "make fire"))
(link-reveal:"SPELLS")[(if: $spells contains "fireball")[](else:)[
(link-replace: "fireball - (text:$fireball's price) GP")[(if: $gold < $fireball's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "fireball"))(set: $gold to $gold - $fireball's price)You have learned fireball.(replace: ?gold)[$gold]]](if: $spells contains "frostbite")[](else:)[
(link-replace: "frostbite - (text:$frostbite's price) GP")[(if: $gold < $frostbite's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "frostbite"))(set: $gold to $gold - $frostbite's price)You have learned frostbite.(replace: ?gold)[$gold]]]](if: $spells contains "lightning bolt")[](else:)[
(link-replace: "lightning bolt - (text: $lightningbolt's price) GP")[(if: $gold < $lightningbolt's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "lightning bolt"))(set: $gold to $gold - $lightningbolt's price)You have learned lightning bolt.(replace: ?gold)[$gold]]]](if: $spells contains "acid splash")[](else:)[
(link-replace: "acid splash - (text:$acidsplash's price) GP")[(if: $gold < $acidsplash's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "acid splash"))(set: $gold to $gold - $acidsplash's price)You have learned acid splash.(replace: ?gold)[$gold]]]](if: $spells contains "earthquake")[](else:)[
(link-replace: "earthquake - (text:$earthquake's price) GP")[(if: $gold < $earthquake's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "earthquake"))(set: $gold to $gold - $earthquake's price)You have learned earthquake.(replace: ?gold)[$gold]]]](if: $spells contains "hail of thorns")[](else:)[
(link-replace: "hail of thorns - (text:$hailofthorn's price) GP")[(if: $gold < $hailofthorn's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "hail of thorns"))(set: $gold to $gold - $hailofthorn's price)You have learned hail of thorns.(replace: ?gold)[$gold]]]]
(if: $spells contains "heal")[](else:)[
(link-replace: "heal - (text:$healspell's price) GP")[(if: $gold < $healspell's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "heal"))(set: $gold to $gold - $healspell's price)You have learned heal.(replace: ?gold)[$gold]]]](if: $spells contains "make fire")[](else:)[
(link-replace: "make fire - (text:$makefire's price) GP")[(if: $gold < $makefire's price)[You do not have enough gold to learn this spell.](else:)[(set: $spells to $spells + (a: "make fire"))(set: $gold to $gold - $makefire's price)You have learned make fire.(replace: ?gold)[$gold]]]]
(if: $spells contains $allspells)[You know all the spells this shop has to offer.]]]
(link-reveal:"POTIONS")[
(link-replace: "health potion - (text: $healthpotion's price) GP")[(if: $gold < $healthpotion's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $healthpotion's price)(set: $healthpotion's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "mana potion - (text: $manapotion's price) GP")[(if: $gold < $manapotion's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $manapotion's price)(set: $manapotion's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]]
(link-reveal:"ARMOR")[
(link-replace: "leather coif (+(text: $leathercoif's armor)) - (text: $leathercoif's price) GP")[(if: $gold < $leathercoif's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $leathercoif's price)(set: $leathercoif's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "chain coif (+(text: $chaincoif's armor)) - (text: $chaincoif's price) GP")[(if: $gold < $chaincoif's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $chaincoif's price)(set: $chaincoif's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "plate helm (+(text: $platehelm's armor)) - (text: $platehelm's price) GP")[(if: $gold < $platehelm's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $platehelm's price)(set: $platehelm's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "leather tunic (+(text: $leathertunic's armor)) - (text: $leathertunic's price) GP")[(if: $gold < $leathertunic's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $leathertunic's price)(set: $leathertunic's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "chain shirt (+(text:$chainshirt's armor)) - (text:$chainshirt's price) GP")[(if: $gold < $chainshirt's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $chainshirt's price)(set: $chainshirt's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "plate breastpiece (+(text: $platebreastpiece's armor)) - (text:$platebreastpiece's price) GP")[(if: $gold < $platebreastpiece's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $platebreastpiece's price)(set: $platebreastpiece's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]]
(link-replace: "leather gloves (+(text: $leatherglove's armor)) - (text: $leatherglove's price) GP")[(if: $gold < $leatherglove's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $leatherglove's price)(set: $leatherglove's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "chain gloves (+(text: $chainglove's armor)) - (text: $chainglove's price) GP")[(if: $gold < $chainglove's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $chainglove's price)(set: $chainglove's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "plate gloves (+(text: $plateglove's armor)) - (text: $plateglove's price) GP")[(if: $gold < $plateglove's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $plateglove's price)(set: $plateglove's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "leather leggings (+(text: $leatherlegging's armor)) - (text: $leatherlegging's price) GP")[(if: $gold < $leatherlegging's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $leatherlegging's price)(set: $leatherlegging's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "chain leggings (+(text: $chainlegging's armor)) - (text: $chainlegging's price) GP")[(if: $gold < $chainlegging's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $chainlegging's price)(set: $chainlegging's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "plate greaves (+(text: $plategreave's armor)) - (text: $plategreave's price) GP")[(if: $gold < $plategreave's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $plategreave's price)(set: $plategreave's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "leather boots (+(text: $leatherboot's armor)) - (text: $leatherboot's price) GP")[(if: $gold < $leatherboot's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $leatherboot's price)(set: $leatherboot's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "chain boots (+(text: $chainboot's armor)) - (text: $chainboot's price) GP")[(if: $gold < $chainboot's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $chainboot's price)(set: $chainboot's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "plate boots (+(text: $plateboot's armor)) - (text: $plateboot's price) GP")[(if: $gold < $plateboot's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $plateboot's price)(set: $plateboot's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]]
(link-reveal:"WEAPONS")[
(link-replace: "axe (+(text: $axe's atk))- (text:$axe's price) GP")[(if: $gold < $axe's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $axe's price)(set: $axe's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]
(link-replace: "dagger (+(text:$dagger's atk))- (text:$dagger's price) GP")[(if: $gold < $dagger's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $dagger's price)(set: $dagger's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "mace (+(text:$mace's atk))- (text:$mace's price) GP")[(if: $gold < $mace's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $mace's price)(set: $mace's count to it + 1)(replace: ?gold)[$gold](go-to: "shop")]]
(link-replace: "staff (+(text:$staff's atk))- (text:$staff's price) GP")[(if: $gold < $staff's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $staff's price)(set: $staff's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]
(link-replace: "sword (+(text:$sword's atk))- (text:$sword's price) GP")[(if: $gold < $sword's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $sword's price)(set: $sword's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]
(link-replace: "bow (no arrows)- (text:$bow's price) GP")[(if: $gold < $bow's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $bow's price)(set: $bow's count to it + 1)(replace: ?gold)[$gold](go-to:"shop")]]
(link-replace: "10 arrows (+(text:$bow's atk))- (text:$arrow's price) GP")[(if: $gold < $arrow's price)[You do not have enough gold for this item.](else:)[(set: $gold to $gold - $arrow's price)(set: $arrow's count to it + 10)You have purchased 10 arrows.(replace: ?gold)[$gold](go-to: "shop")]]]
(link-reveal:"LESSONS")[
(display:"lessons")]
REPAIR:
(set: $weaponrepaircost to (($usemax - $weaponuse)*10))(set: $armorrepaircost to (($armdurmax - $armdur)*10))
(if: $weapon is "bow")[](else:)[(if: $gold < $weaponrepaircost)[repair equipped weapon (link-replace"$weaponrepaircost GP")[You do not have enough gold to repair your weapon.]](if: $gold >= $weaponrepaircost)[repair equipped weapon (link-replace: "$weaponrepaircost GP")[(set: $gold to it - $weaponrepaircost)(set: $weaponuse to $usemax)(replace: ?gold)[$gold]Your weapon is now fully repaired.]]
(link:"SELL")[(go-to:"sell")]
(link:"refresh")[(go-to:"shop2")]
(link:"back")[(go-to: $historyadj's last)]
QUESTS:
(link-replace: "(text: $rattail's req) rat tails - (text: $rattail's questgold) GP and (text: $rattail's questxp) XP - redeem")[(if: $rattail's count < $rattail's req)[You do not have the required items!](else:)[(set: $rattail's count to it - $rattail's req)(set: $rattail's questcount to it + 1)(set: $xpcurr to it + $rattail's questxp)(replace: ?stats)[(display: "stats")](set: $gold to it + $rattail's questgold)You gain (text: $rattail's questgold) GP and (text: $rattail's questxp) XP. You have redeemed this quest (text: $rattail's questcount) time(s).]]
(link-replace: "(text: $finger's req) human fingers - (text: $finger's questgold) GP and (text: $finger's questxp) XP - redeem")[(if: $finger's count < $finger's req)[You do not have the required items!](else:)[(set: $finger's count to it - $finger's rec)(set: $finger's questcount to it + 1)(set: $xpcurr to it + $finger's questxp)(replace: ?stats)[(display: "stats")](set: $gold to it + $finger's questgold)You gain (text: $finger's questgold) GP and (text: $finger's questxp) XP. You have redeemed this quest (text: $finger's questcount) time(s).]]
(link-replace: "(text: $beholdereye's req) beholder eye - (text: $beholdereye's questgold) GP and (text: $beholdereye's questxp) XP - redeem")[(if: $beholdereye's count < $beholdereye's req)[You do not have the required item!](else:)[(set: $beholdereye's count to it - $beholdereye's req)(set: $beholdereye's questcount to it + 1)(set: $xpcurr to it + $beholdereye's questxp)(replace: ?stats)[(display: "stats")](set: $gold to it + $beholdereye's $questgold)You gain (text: $beholdereye's questgold) GP and (text: $beholdereye's questxp) XP. You have redeemed this quest (text: $beholdereye's questcount) time(s).]]
(link-replace: "(text: $batwing's req) bat wings - (text: $batwing's questgold) GP and (text: $batwing's questxp) XP - redeem")[(if: $batwing's count < $batwing's req)[You do not have the required items!](else:)[(set: $batwing's count to it - $batwing's req)(set: $batwing's questcount to it + 1)(set: $xpcurr to it + $batwing's questxp)(replace: ?stats)[(display: "stats")](set: $gold to it + $batwing's questgold)You gain (text: $batwing's questgold) GP and (text: $batwing's questxp) XP. You have redeemed this quest (text: $batwing's questcount) time(s).]]
(link-replace: "(text: $bateye's req) bat eyes - (text: $bateye's questgold) GP and (text: $bateye's questxp) XP - redeem")[(if: $bateye's count < $bateye's req)[You do not have the required items!](else:)[(set: $bateye's count to it - $bateye's req)(set: $bateye's questcount to it + 1)(set: $xpcurr to $bateye's questxp)(replace: ?stats)[(display: "stats")](set: $gold to it + $bateye's questgold)You gain (text: $bateye's questgold) GP and (text: $bateye's questxp) XP. You have redeemed this quest (text: $bateye's questcount) time(s).]]
(link-replace: "(text: $trollscalp's req) troll scalps - (text: $trollscalp's questgold) GP and (text: $trollscalp's questxp) XP - redeem")[(if: $trollscalp's count < $trollscalp's req)[You do not have the required items!](else:)[(set: $trollscalp's count to it - $trollscalp's req)(set: $trollscalp's questcount to it + 1)(set: $xpcurr to it + $trollscalp's questxp)(replace: ?stats)[(display: "stats")](set: $gold to it + $trollscalp's questgold)You gain (text: $trollscalp's questgold) GP and (text: $trollscalp's questxp) XP. You have redeemed this quest (text: $trollscalp's questcount) time(s).]]
(link-replace: "(text: $goblinhand's req) goblin hands - (text: $goblinhand's questgold) GP and (text: $goblinhand's questxp) XP - redeem")[(if: $goblinhand's count < $goblinhand's req)[You do not have the required items!](else:)[(set: $goblinhand's count to it - $goblinhand's req)(set: $goblinhand's questcount to it + 1)(set: $xpcurr to it + $goblinhand's questxp)(replace: ?stats)[(display: "stats")](set: $gold to it + $goblinhand's questgold)You gain (text: $goblinhand's questgold) GP and (text: $goblinhand's questxp) XP. You have redeemed this quest (text: $goblinhand's questcount) time(s).]]
(link-replace: "(text: $wolfmeat's req) pieces of wolf meat - (text: $wolfmeat's questgold) GP and (text: $wolfmeat's questxp) XP - redeem")[(if: $wolfmeat's count < $wolfmeat's req)[You do not have the required items!](else:)[(set: $gold to it + $wolfmeat's questgold)(set: $xpcurr to it + $wolfmeat's questxp)(replace: ?stats)[(display: "stats")](set: $wolfmeat's count to it - $wolfmeat's req)(set: $wolfmeat's questcount to it + 1)You gain (text: $wolfmeat's questgold) GP and (text: $wolfmeat's questxp) XP. You have redeemed this quest (text: $wolfmeat's questcount) time(s).]]
[[back->town]]
You walk around the dragon corpse and open the door behind it.
Just as you had guessed, the room held Princess $princessname-- you have succeeded in your quest!
She looks... concerned.
"Please, adventurer, I'm begging you-- I know it's the reason you're here, but, please. Don't take me back to my mother. She's the reason I'm here-- her men, they're the ones who kidnapped me..."
It looks like you have a decision to make-- you can venture back through the dungeon and forest and return $princessname safely to her kingdom, or you can defy your queen and head off to adventure unknown with the princess.
Your call.
(link:"i will return the princess to the castle")[(set: $princess to "yes")(set: $lawful to $lawfulmax)(go-to:"castle")]
(link:"i will defy my queen")[(set: $princess to "yes")(set: $lawful to $lawfulmin)(go-to:"chaotic ending")]
(if: $spells contains "fireball")[
(if: $manacurr >= $fireball's cost)[(link-replace: "attack with fireball")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "fireball")(set: $playerdmg to $fireball's dmg)(set: $manacurr to it - $fireball's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "frostbite")[
(if: $manacurr >= $frostbite's cost)[(link-replace: "attack with frostbite")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "frostbite")(set: $playerdmg to $frostbite's dmg)(set: $manacurr to it - $frostbite's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "lightning bolt")[
(if: $manacurr >= $lightningbolt's cost)[(link-replace: "attack with lightning bolt")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "lightning bolt")(set: $playerdmg to $lightningbolt's dmg)(set: $manacurr to it - $lightningbolt's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "acid splash")[
(if: $manacurr >= $acidsplash's cost)[(link-replace: "attack with acid splash")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "acid splash")(set: $playerdmg to $acidsplash's dmg)(set: $manacurr to it - $acidsplash's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "earthquake")[
(if: $manacurr >= $earthquake's cost)[(link-replace: "attack with earthquake")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "earthquake")(set: $playerdmg to $earthquake's dmg)(set: $manacurr to it - $earthquake's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[](if: $spells contains "hail of thorns")[
(if: $manacurr >= $hailofthorn's cost)[(link-replace: "attack with hail of thorns")[(set: $plaInit to 0)(set: $monInit to 0)(set: $spell to "hail of thorns")(set: $playerdmg to $hailofthorn's dmg)(set: $manacurr to it - $hailofthorn's cost)(replace: ?stats)[(display:"stats")](go-to:"dragon")]](else:)[]](else:)[]
(if: (history:) contains "charsheet rev")[](else:)[(set: $cha to (random: 5, 15))(set: $int to (random: 5, 15))(set: $str to (random: 5, 15))(set: $dex to (random: 5, 15))(set: $con to (random: 5, 15))(set: $wis to (random: 5, 15))(set: $luck to (random: 5, 10))]CHA: |cha>[(if: (history:) contains "charsheet rev")[$cha -- ](link-replace: "roll")[(if: $race is "fairy")[(if: $class is "rogue")[(set: $cha to (random: 10, 25))](else:)[(set: $cha to (random: 10, 20))]](elseif: $race is "orc")[(set: $cha to (random: 5, 10))](elseif: $race is "dwarf")[(set: $cha to (random: 5, 10))](elseif: $race is "fairy")[(set: $cha to (random: 10, 20))](else:)[(set: $cha to (random: 5, 15))](if: (history:) contains "charsheet rev")[(replace: ?cha)[$cha]](else:)[$cha]]]
INT: |int>[(if: (history:) contains "charsheet rev")[$int -- ](link-replace: "roll")[(if: $race is "orc")[(set: $int to (random 5, 15))](else:)[(set: $int to (random: 5, 20))](if: (history:) contains "charsheet rev")[(replace: ?int)[$int]](else:)[$int]]]
STR: |str>[(if: (history:) contains "charsheet rev")[$str -- ](link-replace: "roll")[(if: $class is "barbarian")[(if: $race is "orc")[(set: $str to (random: 15, 25))](else:)[(set: $str to (random: 10, 20))]](else:)[(if: $race is "orc")[(set: $str to (random: 10, 20))]](else:)[(set: $str to (random: 5, 15))](if: (history:) contains "charsheet rev")[(replace: ?str)[$str]](else:)[$str]]]
DEX: |dex>[(if: (history:) contains "charsheet rev")[$dex -- ](link-replace: "roll")[(if: $class is "rogue")[(if: $race is "dwarf")[(set: $dex to (random: 5, 15))](elseif: $race is "orc")[(set: $dex to (random: 5, 15))](else:)[(set: $dex to (random: 10, 20))]](else:)[(set: $dex to (random: 5, 15))](if: (history:) contains "charsheet rev")[(replace: ?dex)[$dex]](else:)[$dex]]]
CON: |con>[(if: (history:) contains "charsheet rev")[$con -- ](link-replace: "roll")[(if: $class is "ranger")[(if: $race is "dwarf")[(set: $con to (random: 15, 25))](else:)[(set: $con to (random: 10, 20))]](else:)[(if: $race is "dwarf")[(set: $con to (random: 10, 20))]](else:)[(set: $con to (random: 5, 15))](if: (history:) contains "charsheet rev")[(replace: ?con)[$con]](else:)[$con]]]
WIS: |wis>[(if: (history:) contains "charsheet rev")[$wis -- ](link-replace: "roll")[(if: $class is "mage")[(if: $race is "elf")[(set: $wis to (random: 15, 25))](else:)[(set: $wis to (random: 10, 20))]](elseif: $class is "cleric")[(if: $race is "elf")[(set: $wis to (random: 10, 25))](else:)[(set: $wis to (random: 10, 20))]](else:)[(set: $wis to (random: 5, 15))](if: (history:) contains "charsheet rev")[(replace: ?wis)[$wis]](else:)[$con]]]
LUCK: |luck>[(if: (history:) contains "charsheet rev")[$luck -- ](link-replace: "roll")[(if: $class is "cleric")[(if: $race is "human")[(set: $luck to (random: 15, 25))](else:)[(set: $luck to (random: 10, 20))]](else:)[(if: $race is "human")[(set: $luck to (random: 10, 20))](else:)[(set: $luck to (random: 5, 15))]](if: (history:) contains "charsheet rev")[(replace: ?luck)[$luck]](else:)[$luck]]]
(link-replace: "reroll")[(go-to: "charsheet rev")]
(link-replace: "confirm")[(go-to:"begin")]
(set: $hpcurr to $hpmax)
(set: $manacurr to $manamax)
{(if: $int >= 15)[(set: $fireball's price to (round:$fireball's price*0.9))(set: $frostbite's price to (round:($frostbite's price*0.9)))(set: $lightningbolt's price to (round:($lightningbolt's price*0.9)))(set: $earthquake's price to (round:($earthquake's price*0.9)))(set: $acidsplash's price to $acidsplash's price*0.9)(set: $hailofthorn's price to $hailofthorn's price*0.9)(set:$healspell's price to $healspell's price*0.9)(set: $makefire's price to $makefire's price*0.9)
(set: $trollscalp's questxp to it*1.2)(set: $bateye's questxp to it*1.2)(set: $batwing's questxp to it*1.2)(set: $finger's questxp to it*1.2)(set: $goblinhand's questxp to it*1.2)(set: $beholdereye's questxp to it*1.2)(set: $rattail's questxp to it*1.2)]
(if: $cha >= 15)[(set: $healthpotion's price to it*0.9)(set: $manapotion's price to it*0.9)
(set: $dagger's price to it*0.9)(set: $sword's price to it*0.9)(set: $mace's price to it*0.9)(set: $axe's price to it*0.9)(set: $staff's price to it*0.9)(set: $bow's price to it*0.9)(set: $arrow's price to it*0.9)
(set: $leathercoif's price to it*0.9)(set: $leathercoif's sellprice to it*1.2)(set: $chaincoif's price to it*0.9)(set: $chaincoif's sellprice to it*1.2)(set: $platehelm's price to it*0.9)(set: $platehelm's sellprice to it*1.2)
(set: $leathertunic's price to it*0.9)(set: $leathertunic's sellprice to it*1.2)(set: $chainshirt's price to it*0.9)(set: $chainshirt's sellprice to it*1.2)(set: $platebreastpiece's price to it*0.9)(set: $platebreastpiece's sellprice to it*1.2)
(set: $leatherglove's price to it*0.9)(set: $leatherglove's sellprice to it*1.2)(set: $chainglove's price to it*0.9)(set: $chainglove's sellprice to it*1.2)(set: $plateglove's price to it*0.9)(set: $plateglove's sellprice to it*1.2)
(set: $leatherlegging's price to it*0.9)(set:$leatherlegging's sellprice to it*1.2)(set: $chainlegging's price to it*0.9)(set: $chainlegging's sellprice to it*1.2)(set: $plategreave's price to it*0.9)(set: $plategreave's sellprice to it*1.2)
(set: $leatherboot's price to it*0.9)(set: $leatherboot's sellprice to it*1.2)(set: $chainboot's price to it*0.9)(set: $chainboot's sellprice to it*1.2)
(set: $plateboot's price to it*0.9)(set: $plateboot's sellprice to it*1.2)
(set: $dagger's sellprice to it*1.2)(set: $sword's sellprice to it*1.2)(set: $mace's sellprice to it*1.2)(set: $axe's sellprice to it*1.2)(set: $staff's sellprice to it*1.2)(set: $bow's sellprice to it*1.2)
(set: $rabbitmeat's sellprice to (round:it*1.2))(set: $rabbitpelt's sellprice to (round:it*1.2))(set: $wolfpelt's sellprice to (round:it*1.2))(set: $goblinmeat's sellprice to (round: it*1.2))(set: $wolfmeat's sellprice to (round: it*1.2))
(set: $trollscalp's questgold to it*1.2)(set: $bateye's questgold to it*1.2)(set: $batwing's questgold to it*1.2)(set: $finger's questgold to it*1.2)(set: $goblinhand's questgold to it*1.2)(set: $beholdereye's questgold to it*1.2)(set: $rattail's questgold to it*1.2)
]}
There is no way in heaven or earth you're taking $princessname back to her mother, queen or no. There are some things you can't abide.
So you and the once-princess trek back through the dungeon and out into the forest, to a small town in the middle of nowhere.
You settle down and use your new home as a base of operations for your many quests and adventures.
(link:"new game")[(set: (saved-games:) to (saved-games:) - (a: "game"))(go-to: "title")]
(link:"replay")[(go-to: "begin")]
Double-click this passage to edit it.
(if: $armorkind is "Helm")[(set: $armorkind2 to "helm")](if: $armorkind is "Breastpiece")[(set: $armorkind2 to "breastpiece")](if: $armorkind is "Gloves")[(set: $armorkind2 to "gloves")](if: $armorkind is "Greaves")[(set: $armorkind2 to "greaves")](if: $armorkind is "Boots")[(set: $armorkind2 to "boots")](if: $legendaryarmor is 1)[(go-to:"treasure chest")]
You investigate the noise and end up in a small clearing.
Sitting on the ground, entirely unguarded and unprotected, is a (if: $pair contains $armorkind2)[pair of ](else:)[]$armorkind2. It's glowing.
Looks important. You had better take it.
(link:"back")[(set: $legendaryarmor to 1)(set: $legendaryarmor's count to it + 1)(go-to: $historyadj's last)]
(if: $weapontype is "Sword")[(set: $weapontype2 to "sword")](if: $weapontype is "Bow")[(set: $weapontype2 to "bow")](if: $weapontype is "Axe")[(set: $weapontype2 to "axe")](if: $weapontype is "Staff")[(set: $weapontype2 to "staff")](if: $weapontype is "Dagger")[(set: $weapontype2 to "dagger")](if: $weapontype is "Mace")[(set: $weapontype2 to "mace")](if: $legendaryweap is "yes")[(go-to: "treasure chest")]
You go to investigate the noise and trip over a $weapontype2, falling flat on your face and hurting yourself. (set: $hpcurr to it - 2)(replace: ?stats)[(display:"stats")]
The $weapontype2 looks like it might be really valuable (it's glowing), though, so you can't even get too mad about it.
(link:"back")[(set: $legendaryweap to 1)(set: $legendaryweapon's count to it + 1)(go-to: $historyadj's last)]