diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2012-01-18 23:58:30 -0700 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2012-01-18 23:58:30 -0700 |
| commit | 3232d0069421a1585e7e42f503c1ed7b1910891c (patch) | |
| tree | 0d2c5ed5e24a9ffeb3c1b3c08528971a8a3d587e /demo.stage | |
| parent | 0bdd1441fc95f70f2f86c89c20eb866a9ca2787b (diff) | |
| download | stage-3232d0069421a1585e7e42f503c1ed7b1910891c.tar.gz stage-3232d0069421a1585e7e42f503c1ed7b1910891c.tar.bz2 stage-3232d0069421a1585e7e42f503c1ed7b1910891c.tar.xz stage-3232d0069421a1585e7e42f503c1ed7b1910891c.zip | |
Added functions join, string, and keys.
Diffstat (limited to '')
| -rw-r--r-- | demo.stage | 28 |
1 files changed, 7 insertions, 21 deletions
| @@ -31,21 +31,10 @@ global | |||
| 31 | { | 31 | { |
| 32 | if exists(situation.exits) then | 32 | if exists(situation.exits) then |
| 33 | { | 33 | { |
| 34 | out = "Obvious exits are: "; | 34 | display( "Obvious exits are: " + join( |
| 35 | bFirst = true; | 35 | keys( situation.exits ), |
| 36 | for each dir : dest in situation.exits do | 36 | ", " |
| 37 | { | 37 | ) ); |
| 38 | if bFirst then | ||
| 39 | { | ||
| 40 | bFirst = false; | ||
| 41 | } | ||
| 42 | else | ||
| 43 | { | ||
| 44 | out += ", "; | ||
| 45 | } | ||
| 46 | out += dir; | ||
| 47 | } | ||
| 48 | display( out ); | ||
| 49 | } | 38 | } |
| 50 | else | 39 | else |
| 51 | { | 40 | { |
| @@ -77,17 +66,13 @@ global | |||
| 77 | */ | 66 | */ |
| 78 | command: "inventory" | 67 | command: "inventory" |
| 79 | { | 68 | { |
| 80 | out = 'You are carrying: '; | 69 | out = 'You are carrying: ' + join( player.inventory, ", " ); |
| 81 | for each item in player.inventory do | ||
| 82 | { | ||
| 83 | out += " " + item; | ||
| 84 | } | ||
| 85 | display( out ); | 70 | display( out ); |
| 86 | } | 71 | } |
| 87 | 72 | ||
| 88 | // You should always have a global exit, quit, escape, something for | 73 | // You should always have a global exit, quit, escape, something for |
| 89 | // dev-testing at least. | 74 | // dev-testing at least. |
| 90 | command: "exit" | 75 | command: "quit" |
| 91 | { | 76 | { |
| 92 | exit(); | 77 | exit(); |
| 93 | } | 78 | } |
| @@ -147,6 +132,7 @@ situation <<beachCenter>> | |||
| 147 | 'east': <<beachEast>>, | 132 | 'east': <<beachEast>>, |
| 148 | 'west': <<beachWest>> | 133 | 'west': <<beachWest>> |
| 149 | }; | 134 | }; |
| 135 | situation.items = ['stick']; | ||
| 150 | } | 136 | } |
| 151 | enter | 137 | enter |
| 152 | { | 138 | { |
