-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemsExample.html
83 lines (61 loc) · 3.65 KB
/
ItemsExample.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!--
ADDING ITEMS
---
with the inventory system, you must be careful of adding items more than once if you don't want too. This is due to the inventory and quest passages being new passages therefore 'resetting' passages when you return to them.
These examples show ways to add items avoding that.
They also show how to add class specfic items.-->
<!--Example 1: simple way to add items to avoid duplication.
You can change the passage text or leave it the same depending on what works best for your story.-->
<h1>Ruby</h1>
(if: $inv contains "Ruby")[You are in a dark room lit with torches. The chest you opened is empty.]
(else:)[(set: $inv to $inv + (a: "Ruby"))
You are in a dark room lit with torches. Inside a chest you find a ruby!]
<!--Example 2: Class dependent items.
This is best for the start of the game but could be used as a way to get back game completion required items if you loose all of your items-->
<h1>Grandma</h1>
(if: $inv's length < 1)[
Your Grandma gives you something to use on your adventure!
(if: $class is "Mage")[(set: $inv to $inv + (a: "Spellbook")) (set: $gold to 10) She hands you a small ''spellbook'' and some gold coins..]
(if: $class is "Warrior")[(set: $inv to $inv + (a: "Sword")) (set: $gold to 10)She hands you a ''sword'' and some gold coins.. ]
(if: $class is "Rouge")[(set: $inv to $inv + (a: "Slingshot"))(set: $gold to 10) She hands you your ''slingshot'' and some gold coins.]]
(else:)[Your Grandma has given you something to use on your adventure! As you saw when you checked your inventory]
<!--Example 3: searching a room by clicking named hooks-->
<!--Make sure either that these are items you won't find multiple times on your adventure,
or your player will be told they've searched somewhere they haven't looked.
Alternatively, reword this passage to say for example 'you see a sword and sheild on a wepons rack but you have these items already' for the else marco.
That way things make sense if the player had these items before this passage or picked them up from this passage and checked their inventry.-->
<h1>Search the room</h1>
[''Check the chest?'']<1a|
[''Check the bookcase'']<1b|
[''Check the weapons rack?'']<1c|
<br>
(if: $inv contains "ruby")[You've searched the chest.]
(else:)[(click:?1a)[(set: $inv to $inv + (a: "ruby")) You find a ruby in the chest!]]
(if: $inv contains "bestiary")[You've searched the bookcase]
(else:)[(click:?1b)[(set: $inv to $inv + (a: "bestiary"))You find a book on the monsters of this land.]]
(if: $inv contains "sword" and "shield")[You've searched the weapons rack.]
(else:)[(click:?1c)[(set: $inv to $inv + (a: "sword","shield")) You find a good sword and shield.]]
<!--
Removing ITEMS
---
-->
<!--Removing items is a little easier than adding them.-->
<!--Example 1:Removing a single item-->
<h1>Dropped it</h1>
(set: $inv to $inv - (a: "Sword"))
If you have a sword you just dropped it!
<!--Example 2:Removing two items-->
<h1>Dropped it</h1>
(set: $inv to $inv - (a: "Sword", "Spellbook"))
If you have a sword or spellbook you just dropped it!
<!-- Example 3: Removing an item depending on if the player has it in their inventory.
I find this better than the above as you don't have redudant information about dropping an item you don't have. -->
<h1>Dropped it</h1>
(if: $inv contains "Sword")[(goto:"dropped sword")]
(Else:)[You stumble but don't loose anything!]
<!--name this passage 'dropped sword"
If this is adapted for an item the player would have more than one of add the tags,
donotshowinventory and donotshowquest to the passage avoid taking the one of the named item each time they check their inventory.-->
<h1>Oh no!</h1>
(set: $inv to $inv - (a: "Sword"))
You dropped your sword!