-
Notifications
You must be signed in to change notification settings - Fork 0
/
UsefulCodeBits.html
41 lines (29 loc) · 1.38 KB
/
UsefulCodeBits.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
<!--These are bits of useful code for your game. -->
<!--remove health-->
(set:$health to $health -5)
<!--add health-->
(set:$health to $health +5)
<!--for this to work you need a passage called Death. You could link this back to the start of your game to give players another chance.
Do not put this in the footer passage, it seems tempting to make sure you don't have to add it to every passage, but Twine won't like that.-->
(if: $health is <=1)[(go-to: "Death")]
<!--add to inv. use commas to add more than one item-->
(set: $inv to $inv + (a: "Item1", "Item2"))
<!--take from inv-->
(set: $inv to $inv - (a: "Item1"))
<!--add to quest-->
(set: $quest to $quest+ (a: "Quest1"))
<!--take from quest-->
(set: $quest to $quest- (a: "Quest1"))
<!--add to gold-->
(set: $gold to $gold + 5)
<!--take from gold-->
(set: $gold to $gold - 5)
<!--class dependent passages can also be done! check examples for more complex uses.-->
(if: $class is "Mage")[You recgonise the runes as telling you to go left.]
(else:)[You do not understand the runes.]
<!--You can just use the if marco for each class to customise your character class responce to events like so.-->
The dragon snoozes, their hoard of books under them.
(if: $class is "Warrior")[You want to fight them!]
(if: $class is "Mage")[You want to read the books]
(if: $class is "Rouge")[You want to sneak around them]
[[The dragon wakes->Oh no]]