1
0
Fork 0
mirror of https://github.com/Oreolek/gamebookformat.git synced 2024-06-28 20:55:13 +03:00
gamebookformat/examples/counters.gamebook
Pelle Nilsson 6fa4245e02 Initial value for counters (something it is not reset to when revisiting).
Also fixed DOT output that was quite broken.
2013-08-04 00:16:02 +02:00

55 lines
2.1 KiB
Plaintext

title = Counters Example
= Introduction
This example gamebook shows how to use counters.
* 1 start
This is where the gamebook starts.
We have counters for [count life]Life Points[/count] and for
[count gold]Gold[/count]. You start the adventure with
[set life]10[/set] Life Points and [set gold]12[/set] Gold.
You can never have less than [min gold]0[/min] Gold. FIXME need to
figure out best syntax for death when life points go below 1.
Go to [[getgold]] to get more Gold or [[dangerous]] to lose some Life Points.
Go to [[inittest]] for testing the init value markup.
* getgold
Congratulations, you found [inc gold]2[/gold] Gold.
If you have less than [lessthan life]1[/lessthan] Life Points,
turn to [[auto death]].
You can go to [[dangerous]] to lose some life or to [[losegold]] to drop
some gold. If you have at least [atleast gold]16[/atleast] Gold you
can turn to [[hurrah]]. If you have even more than
[morethan gold]16[/morethan] Gold you can turn to [[rich]].
* dangerous
You lose [dec life]1[/dec] Life Points.
You can go to [[getgold]] to get some Gold.
* losegold
You drop [dec gold]5[/dec] Gold. It should not be possible to
go below 0. Then go on to get gold at [[getgold]] or lose life at [[dangerous]].
* rich
You have more than 16 Gold. How nice.
Go back to get some more at [[getgold]].
* hurrah
You have at least 16 gold. Go back to get some more at [[getgold]].
* death
Less than 1 Life Point means the adventure ends now.
* inittest
The [count something]Something Counter[/count]
starts at [init something]5[/init], but when
you come back here it will not reset to that, unlike the
[count other]Other Counter[/count]
that will reset to [set other]5[/set] every time you get
here. If we try to init gold to [init gold]999[/init] nothing
will happen because it was already set to something before you
came yere. Go on to [[inittest2]].
* inittest2
OK, we increase that something counter by [inc something]1[/inc]
here, and also increase the other counter by [inc other]1[/inc].
You can go back to see the difference between set and init
[[inittest][here]], stuck in an infinite loop.