-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShopExample.html
32 lines (22 loc) · 1.29 KB
/
ShopExample.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<h1>Shop</h1>
<!--as the gold number updates statically to get it to update viusally you must send the player to a new passage.
This system allows for duplicate item purchase, but if you use some of the code in ItemsExample.html you can make items only be brought once.
This system also stops the player buying things if they lack the gold.-->
"Hello, here is what I sell," Says the shop owner.
A potion of health: 5 gold(click:"potion of health")[(go-to:"potion of health")]
A crystal ball: 10 gold(click:"crystal ball")[(go-to:"crystal ball")]
A lockpick: 3 gold(click:"lockpick")[(go-to:"lockpick")]
[[Go to town?->town]]
<!--Put this text into another passage titled the same as the goto. You can design the other passages with the same code,
just change the values.
add the tags donotshowinventory and donotshowquest so the player won't end up buying additonal items if they check their inventory from this passage-->
<h1>potion of health</h1>
(if: $gold is >=5)[(set: $gold to $gold - 5)(set: $inv to $inv + (a: "potion of health"))
"Here you go!" He says and hands you the potion of health.
[[buy more->shop]
[[Go to the town?->town]]]
<!--this makes you unable to buy the item if you lack the money-->
(else:)[
"You don't have enough money." He says.
[[buy more->shop]]
[[Go to the town?->town]]]