@@ -8,7 +8,263 @@ fn main() {
88
99 cli. start ( ) ;
1010 } else {
11- let cli = Cli :: from_file ( "worlds/world.ron" ) ;
11+ let cli = Cli :: from_ron_str (
12+ r#"
13+ (world: World(
14+ curr_room: "Brig",
15+ rooms: {
16+ "Brig": Room(
17+ name: "Brig",
18+ desc: "You are in a small wooden room with a wood pillar in the middle.
19+ The ground slowly creaks and rocks beneath you.",
20+ paths: [
21+ Pathway(
22+ directions: ["door", "n"],
23+ target: "Hold 1",
24+ desc: "There is a door on the north side.",
25+ inspect: "The door is plain and wooden.",
26+ opening: Some(Closed),
27+ ),
28+ ]
29+ ),
30+ "Hold 1": Room(
31+ name: "Hold",
32+ desc: "You are in the middle of a spacious hold. Crates and barrels array the sides.",
33+ paths: [
34+ Pathway(
35+ directions: ["door", "s"],
36+ target: "Brig",
37+ desc: "There is a door at the south end of the hold.",
38+ inspect: "The door is plain and wooden.",
39+ opening: Some(Open),
40+ ),
41+ Pathway(
42+ directions: ["n"],
43+ target: "Hold 2",
44+ desc: "The hold continues to the north.",
45+ inspect: "This end of the hold is too dark to see into.",
46+ ),
47+ ],
48+ ),
49+ "Hold 2": Room(
50+ name: "Hold",
51+ desc: "You are at the end of a spacious hold. Crates and barrels array the sides.",
52+ paths: [
53+ Pathway(
54+ directions: ["hatch", "u"],
55+ target: "Crew Deck 1",
56+ desc: "There is a hatch above you.",
57+ inspect: "It looks like a metal grate.",
58+ opening: Some(Closed),
59+ ),
60+ Pathway(
61+ directions: ["s"],
62+ target: "Hold 1",
63+ desc: "The hold continues to the south.",
64+ inspect: "The middle of the hold is lit by a lantern.",
65+ ),
66+ ]
67+ ),
68+ "Crew Deck 1": Room(
69+ name: "Crew Deck",
70+ desc: "You are on a deck with dirty hammocks hanging everywhere.",
71+ paths: [
72+ Pathway(
73+ directions: ["hatch", "d"],
74+ target: "Hold 2",
75+ desc: "There is a hatch on the ground",
76+ inspect: "It looks like a metal grate.",
77+ opening: Some(Open),
78+ ),
79+ Pathway(
80+ directions: ["s"],
81+ target: "Crew Deck 2",
82+ desc: "The deck continues to the south.",
83+ inspect: "There is a doorway at the south end of the deck.",
84+ ),
85+ ]
86+ ),
87+ "Crew Deck 2": Room(
88+ name: "Crew Deck",
89+ desc: "You are on a deck with dirty hammocks hanging everywhere.",
90+ paths: [
91+ Pathway(
92+ directions: ["opening", "u"],
93+ target: "Cannon Deck 2",
94+ desc: "There is an opening above you.",
95+ inspect: "You think you might be able to see the light of day.",
96+ ),
97+ Pathway(
98+ directions: ["n"],
99+ target: "Crew Deck 1",
100+ desc: "The deck continues to the north.",
101+ inspect: "There is a hatch at the north end of the deck.",
102+ ),
103+ Pathway(
104+ directions: ["empty doorway", "s"],
105+ target: "Infirmary",
106+ desc: "There is an empty doorway to the south.",
107+ inspect: "The doorway flickers with lantern light.",
108+ ),
109+ ]
110+ ),
111+ "Infirmary": Room(
112+ name: "Infirmary",
113+ desc: "You are in a room with a few empty beds against one wall.",
114+ paths: [
115+ Pathway(
116+ directions: ["doorway", "n"],
117+ target: "Crew Deck 2",
118+ desc: "The doorway leads back into the crew's quarters.",
119+ inspect: "The doorway flickers with lantern light.",
120+ ),
121+ ]
122+ ),
123+ "Cannon Deck 1": Room(
124+ name: "Cannon Deck",
125+ desc: "This deck has cannons lining each side.",
126+ paths: [
127+ Pathway(
128+ directions: ["s"],
129+ target: "Cannon Deck 2",
130+ desc: "The deck continues to the south.",
131+ inspect: "This ship sure has a lot of cannons.",
132+ ),
133+ Pathway(
134+ directions: ["hatch", "u"],
135+ target: "Main Deck",
136+ desc: "A hatch above you bring in bright sunlight.",
137+ inspect: "The hatch is a double-hinged grate made of old rusty metal.",
138+ opening: Some(Closed),
139+ ),
140+ ],
141+ ),
142+ "Cannon Deck 2": Room(
143+ name: "Cannon Deck",
144+ desc: "This deck has cannons lining each side.",
145+ paths: [
146+ Pathway(
147+ directions: ["n"],
148+ target: "Cannon Deck 1",
149+ desc: "The deck continues to the north.",
150+ inspect: "This ship sure has a lot of cannons.",
151+ ),
152+ Pathway(
153+ directions: ["doorway", "s"],
154+ target: "Empty Room",
155+ desc: "There is a doorway to the south.",
156+ inspect: "The doorway is completely dark.",
157+ ),
158+ Pathway(
159+ directions: ["opening", "d"],
160+ target: "Crew Deck 2",
161+ desc: "There is an opening below you.",
162+ inspect: "You can see hammocks through the opening.",
163+ ),
164+ ]
165+ ),
166+ "Empty Room": Room(
167+ name: "Empty Room",
168+ desc: "The room is dark and empty.",
169+ paths: [
170+ Pathway(
171+ directions: ["doorway", "n"],
172+ target: "Cannon Deck 2",
173+ desc: "The doorway leads back into the cannon deck.",
174+ inspect: "You see many cannons.",
175+ ),
176+ ]
177+ ),
178+ "Main Deck": Room(
179+ name: "Main Deck",
180+ desc: "The vast open sea surrounds the ship you stand on.",
181+ paths: [
182+ Pathway(
183+ directions: ["hatch", "d"],
184+ target: "Cannon Deck 1",
185+ desc: "There is a hatch below you.",
186+ inspect: "The hatch is a double-hinged grate made of old rusty metal.",
187+ opening: Some(Open),
188+ ),
189+ Pathway(
190+ directions: ["mast", "platform", "u"],
191+ target: "Platform",
192+ desc: "There is a platform above you on the central mast.",
193+ inspect: "The platform can be reached through holds on the mast.",
194+ ),
195+ Pathway(
196+ directions: ["stairs", "s"],
197+ target: "Sterncastle",
198+ desc: "Stairs towards the south lead upwards onto the sterncastle.",
199+ inspect: "The stairs are old and dirty.",
200+ ),
201+ Pathway(
202+ directions: ["door"],
203+ target: "Captains Cabin",
204+ desc: "There is door on the wall beneath the sterncastle of the ship.",
205+ inspect: "The door is large with a small dim window in the center.",
206+ opening: Some(Closed),
207+ ),
208+ ]
209+ ),
210+ "Sterncastle": Room(
211+ name: "Sterncastle",
212+ desc: "You are on the sterncastle of the ship. There is another mast in the center and a the ships wheel.",
213+ paths: [
214+ Pathway(
215+ directions: ["stairs", "n", "d"],
216+ target: "Main Deck",
217+ desc: "The stairs lead back onto the main deck.",
218+ inspect: "The stairs are old and dirty.",
219+ ),
220+ ],
221+ ),
222+ "Captains Cabin": Room(
223+ name: "Captains Cabin",
224+ desc: "You stand in a large cabin with the captains belongins littering the ground and hanging on the walls.",
225+ paths: [
226+ Pathway(
227+ directions: ["door", "n"],
228+ target: "Main Deck",
229+ desc: "There is door at the north end of the room.",
230+ inspect: "The door is large with a small dim window in the center.",
231+ opening: Some(Open),
232+ ),
233+ ],
234+ ),
235+ "Platform": Room(
236+ name: "Platform",
237+ desc: "You stand on a platform several feet above the main deck.",
238+ paths: [
239+ Pathway(
240+ directions: ["d"],
241+ target: "Main Deck",
242+ desc: "The main deck is below you.",
243+ inspect: "The main deck is several feet below.",
244+ ),
245+ Pathway(
246+ directions: ["crows nest", "u"],
247+ target: "Crows Nest",
248+ desc: "There is a crows nest above you on the central mast.",
249+ inspect: "The crows nest can be reached through holds and rigging on the mast.",
250+ ),
251+ ]
252+ ),
253+ "Crows Nest": Room(
254+ name: "Crows Nest",
255+ desc: "You are in a crows nest overlooking the entire ship and sea.",
256+ paths: [
257+ Pathway(
258+ directions: ["mast", "platform", "d"],
259+ target: "Platform",
260+ desc: "There is a platform below you on the central mast.",
261+ inspect: "The platform can be reached through holds on the mast.",
262+ ),
263+ ]
264+ ),
265+ }))
266+ "# ,
267+ ) ;
12268 cli. add_item (
13269 "Brig" ,
14270 Item :: Weapon ( Weapon :: new ( "stick" , "It's short but stout." , 4 ) ) ,
0 commit comments