forked from okaybenji/text-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadvanceBaseGame.js
43 lines (41 loc) · 1.52 KB
/
advanceBaseGame.js
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
42
const advance = {
roomId: "hub",
rooms: [
{
id: "hub",
name: "Advance! Hub",
desc: "Welcome to **Advance!** Get out there by running **ADVANCE**!"
},
{
id: "openingShip",
name: "Advancing Ferry Front Deck",
desc: "The ferry is headed to a wonderful place named Onwardtown. While you wait, how about you **LOOK** around?",
onLook: () => {
getRoom("openingShip").desc = `There is a large sea of water in front of you. To the **SOUTH**, there is an entrance to the interior passanger compartment. There is a stereotypical-looking sailor standing beside the door.
He asks, "What do you think you're looking at, son?"`
}
}
],
characters: [
{
name: ["sailor","rude man","man"],
roomId: "openingShip",
desc: `You look at the man. After concluding once again that he is a sailor, you feel pretty smart.`
}
]
}
const advanceCommand = () => {
if(disk.roomId == "hub") {
println("Advancing...");
enterRoom("openingShip");
} else {
println("You don't see any way to advance further, probably because you are an idiot who just typed in the start command after the game had already started.")
}
};
commands[0] = Object.assign(commands[0], {
advance: advanceCommand,
north: () => goDir("north"),
south: () => goDir("south"),
east: () => goDir("east"),
west: () => goDir("west")
})