diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-12-31 00:13:13 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-12-31 00:13:13 -0700 |
commit | 55e6f570f5760e970c6523458914b5e4c63a6ce4 (patch) | |
tree | ae996d612c6c55b914a960139a618922bf7e4971 /demo.stage | |
parent | 3357b0a0ecc4d36ccd3c2668e9d55aaaefedf4df (diff) | |
download | stage-55e6f570f5760e970c6523458914b5e4c63a6ce4.tar.gz stage-55e6f570f5760e970c6523458914b5e4c63a6ce4.tar.bz2 stage-55e6f570f5760e970c6523458914b5e4c63a6ce4.tar.xz stage-55e6f570f5760e970c6523458914b5e4c63a6ce4.zip |
Random function added, other fixes.
Diffstat (limited to 'demo.stage')
-rw-r--r-- | demo.stage | 84 |
1 files changed, 55 insertions, 29 deletions
@@ -45,47 +45,44 @@ global | |||
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
48 | // You should always have a global exit, quit, escape, something for | 48 | command: "take" item |
49 | // dev-testing at least. | ||
50 | command: "exit" | ||
51 | { | 49 | { |
52 | exit(); | 50 | if exists(situation.items) then |
51 | { | ||
52 | if item in situation.items then | ||
53 | { | ||
54 | situation.items -= item; | ||
55 | player.inventory += item; | ||
56 | display("You take the " + item); | ||
57 | return(); | ||
58 | } | ||
59 | } | ||
60 | display("You don't see that anywhere."); | ||
53 | } | 61 | } |
54 | } | ||
55 | |||
56 | function square( x ) | ||
57 | { | ||
58 | return( x*x ); | ||
59 | } | ||
60 | 62 | ||
61 | function sillyDisplay( txt, extra ) | 63 | command: "inventory" |
62 | { | ||
63 | display("!~! " + txt + " !~!"); | ||
64 | if extra then | ||
65 | { | 64 | { |
66 | display("And then some extra!"); | 65 | out = 'You are carrying: '; |
66 | for each item in player.inventory do | ||
67 | { | ||
68 | out += " " + item; | ||
69 | } | ||
70 | display( out ); | ||
67 | } | 71 | } |
68 | else | 72 | |
73 | // You should always have a global exit, quit, escape, something for | ||
74 | // dev-testing at least. | ||
75 | command: "exit" | ||
69 | { | 76 | { |
70 | display("...no extra for you"); | 77 | exit(); |
71 | } | 78 | } |
72 | } | 79 | } |
73 | 80 | ||
74 | function myGoto( txt ) | ||
75 | { | ||
76 | display( txt ); | ||
77 | goto( txt ); | ||
78 | } | ||
79 | |||
80 | function getThing() | ||
81 | { | ||
82 | display( situation.thing ); | ||
83 | } | ||
84 | |||
85 | situation <<start>> | 81 | situation <<start>> |
86 | { | 82 | { |
87 | setup | 83 | setup |
88 | { | 84 | { |
85 | player.inventory = []; | ||
89 | goto( <<diningRoom>> ); | 86 | goto( <<diningRoom>> ); |
90 | } | 87 | } |
91 | 88 | ||
@@ -102,6 +99,7 @@ situation <<diningRoom>> | |||
102 | 'south': <<livingRoom>>, | 99 | 'south': <<livingRoom>>, |
103 | 'east': <<kitchen>> | 100 | 'east': <<kitchen>> |
104 | }; | 101 | }; |
102 | situation.items = ['postcard']; | ||
105 | } | 103 | } |
106 | enter | 104 | enter |
107 | { | 105 | { |
@@ -127,15 +125,43 @@ situation <<livingRoom>> | |||
127 | 125 | ||
128 | situation <<kitchen>> | 126 | situation <<kitchen>> |
129 | { | 127 | { |
128 | command: "open" "cupboard" | ||
129 | { | ||
130 | if not situation.bCupboardOpen then | ||
131 | { | ||
132 | situation.bCupboardOpen = true; | ||
133 | if "pan" in situation.cupboardItems then | ||
134 | { | ||
135 | display("You open the cupboard, it's mostly empty. There is a | ||
136 | single frying pan inside."); | ||
137 | situation.cupboardItems -= "pan"; | ||
138 | situation.items += "pan"; | ||
139 | |||
140 | } | ||
141 | else | ||
142 | { | ||
143 | display("You open the cupboard, it's empty."); | ||
144 | } | ||
145 | } | ||
146 | else | ||
147 | { | ||
148 | display("The cupboard is already open."); | ||
149 | } | ||
150 | } | ||
151 | |||
130 | setup | 152 | setup |
131 | { | 153 | { |
132 | situation.exits = { | 154 | situation.exits = { |
133 | 'west': <<diningRoom>> | 155 | 'west': <<diningRoom>> |
134 | }; | 156 | }; |
157 | situation.bCupboardOpen = false; | ||
158 | situation.cupboardItems = ['pan']; | ||
159 | situation.items = []; | ||
135 | } | 160 | } |
136 | 161 | ||
137 | enter | 162 | enter |
138 | { | 163 | { |
139 | display('''Kitchen!'''); | 164 | display('''You are standing in the kitchen. There is an electric |
165 | range, a microwave, cupboards, a fridge, and a window.'''); | ||
140 | } | 166 | } |
141 | } | 167 | } |