You've been adventuring for $days days. You have $coins coins and your health is $hp.
[[rest]]
[[adventure|start adventure]]
[[shop]]
[[cheat]]{(set: $hp to $max_hp)
(set: $days to $days + 1)}
You feel refreshed.
(display: "main")(set: $monster_hp to (either: 2,3,5)) A (if: $monster_hp is 2)[small](else-if: $monster_hp is 3)[big](else:)[huge] monster appears!
[[fight]]
[[flee|main]]Your current weapon is a (print: $weapon's id), which does (print: $weapon's damage) damage.
(set: $next_weapon to $weapon's next)
(if: not ($next_weapon is 0))[
(set: $nwn to $next_weapon's id)
[[buy $nwn->buy]] ((print: $next_weapon's cost) coins, does (print: $next_weapon's damage) damage)]
[[go back home->main]]{(set: $max_hp to 10)
(set: $hp to $max_hp)
(set: $coins to 10)
(set: $days to 0)
(set: $weapons_damage to (datamap: "dagger", 1, "small sword", 3, "big sword", 5))
(set: $big_sword to (datamap: "id", "big sword", "cost", 50, "damage", 5, "next", 0))
(set: $small_sword to (datamap: "id", "small sword", "cost", 30, "damage", 3, "next", $big_sword))
(set: $dagger to (datamap: "id", "dagger", "cost", 10, "damage", 1, "next", $small_sword))
(set: $weapon to $dagger)}
(display: "main")(if: (either: 0, 1) is 0)[The monster bites you! (set: $hp to $hp - (either: 1,2,3))
(if: $hp < 1)[You are [[dead]]!](else:)[
Your health is $hp.
[[fight]]
[[flee|main]] ]
](else:)[You hit the monster!
{(set:$monster_hp = $monster_hp - ($weapon's damage))}
(if: $monster_hp < 1)[The [[monster is dead]]!
](else:)[Its health is $monster_hp.
[[fight]]
[[flee|main]] ]
][[restart?|init]](set: $streak to $streak + 1) (set: $drop to (random: 3,10) * $streak) You collect $drop coins from the monster carcass! (set: $spoils to $spoils + $drop) Your spoils are currently $spoils coins and your health is $hp. You've killed $streak monsters on this adventure.
[[continue|adventure]]
[[go home|collect spoils]](set: $spoils to 0) (set: $streak to 0) (display: "adventure")(set: $coins to $coins + $spoils) (display: "main")(if: $coins > ($small_sword's cost))[(set: $weapon to $small_sword) (set: $coins to $coins - ($weapon's cost)) (display: "shop")]
(else:)[You don't have enough money!
(display: "shop")](if: $coins > 50)[(set: $weapon to $big_sword) (set: $coins to $coins - 50) (display: "shop")]
(else:)[You don't have enough money!
(display: "shop")](set: $coins to 10000)(display: "main")(if: $coins > ($next_weapon's cost))[(set: $weapon to $next_weapon) (set: $coins to $coins - ($weapon's cost)) (display: "shop")]
(else:)[You don't have enough money!
(display: "shop")]