More updates to the example game. Won't be specific here - too much changing, sorry.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -13,6 +13,6 @@ from . import vars
|
|||||||
# Build the game state
|
# Build the game state
|
||||||
game = Game(
|
game = Game(
|
||||||
database=database,
|
database=database,
|
||||||
room=database.rooms["inside_cabin"],
|
room=database.rooms["cabin_inside"],
|
||||||
vars=vars.vars,
|
vars=vars.vars,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ database.add_items(
|
|||||||
room_desc="A door rests upon the south wall.",
|
room_desc="A door rests upon the south wall.",
|
||||||
synonyms=("door",),
|
synonyms=("door",),
|
||||||
triggers={
|
triggers={
|
||||||
LOOK: [PrintAction("A strong, sturdy door.")],
|
LOOK: [PrintAction("A strong, sturdy door leading outside.")],
|
||||||
GET: [PrintAction("The door is firmly attached to the wall.")],
|
GET: [PrintAction("The door is firmly attached to the wall.")],
|
||||||
# Don't actually worry about the door being open here. It's just a
|
# Don't actually worry about the door being open here. It's just a
|
||||||
# nice flavoring.
|
# nice flavoring.
|
||||||
GO: [PrintAction("You exit the cabin."), TeleportAction("outside_cabin")],
|
GO: [
|
||||||
|
PrintAction("You step outside."),
|
||||||
|
TeleportAction("cabin_outside"),
|
||||||
|
],
|
||||||
OPEN: [
|
OPEN: [
|
||||||
CheckVarAction(
|
CheckVarAction(
|
||||||
"cabin_door_open",
|
"cabin_door_open",
|
||||||
@@ -68,7 +71,10 @@ database.add_items(
|
|||||||
room_desc=None,
|
room_desc=None,
|
||||||
triggers={
|
triggers={
|
||||||
LOOK: [PrintAction("It's brown and gray.")],
|
LOOK: [PrintAction("It's brown and gray.")],
|
||||||
GO: [PrintAction("You exit the cabin."), TeleportAction("outside_cabin")],
|
GO: [
|
||||||
|
PrintAction("You step outside."),
|
||||||
|
TeleportAction("cabin_outside"),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Item(
|
Item(
|
||||||
@@ -80,12 +86,12 @@ database.add_items(
|
|||||||
LOOK: [PrintAction("It's brown and gray.")],
|
LOOK: [PrintAction("It's brown and gray.")],
|
||||||
OPEN: [
|
OPEN: [
|
||||||
PrintAction(
|
PrintAction(
|
||||||
"This window is simply a pane of glass in a fixed frame, it be neither opened nor closed."
|
"This window is simply a pane of glass in a fixed frame, it can be neither opened nor closed."
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
CLOSE: [
|
CLOSE: [
|
||||||
PrintAction(
|
PrintAction(
|
||||||
"This window is simply a pane of glass in a fixed frame, it be neither opened nor closed."
|
"This window is simply a pane of glass in a fixed frame, it can be neither opened nor closed."
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
GO: [PrintAction("Try using the door instead.")],
|
GO: [PrintAction("Try using the door instead.")],
|
||||||
@@ -95,7 +101,7 @@ database.add_items(
|
|||||||
|
|
||||||
database.add_room(
|
database.add_room(
|
||||||
Room(
|
Room(
|
||||||
id="inside_cabin",
|
id="cabin_inside",
|
||||||
name="Inside the cabin",
|
name="Inside the cabin",
|
||||||
desc="",
|
desc="",
|
||||||
items=[
|
items=[
|
||||||
@@ -113,11 +119,11 @@ database.add_room(
|
|||||||
|
|
||||||
ANJAS_LETTER = [
|
ANJAS_LETTER = [
|
||||||
"Dear Juni!",
|
"Dear Juni!",
|
||||||
"If you are reading this message you have finally arrived in the West, near where "
|
"If you are reading this message you have finally arrived at my cabin in the "
|
||||||
"the horrible machine resides. Turn it off, and its life-sapping force in the "
|
"West. Continue your journey further into the west - that is where the machine "
|
||||||
"world will cease.",
|
"resides. Turn it off, and this land will begin healing anew.",
|
||||||
"You are our only hope - we are counting on you!",
|
"You are our only hope - we are counting on you!",
|
||||||
"Anja",
|
"- Anja",
|
||||||
]
|
]
|
||||||
database.add_items(
|
database.add_items(
|
||||||
Item(
|
Item(
|
||||||
@@ -131,7 +137,7 @@ database.add_items(
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
Item(
|
Item(
|
||||||
id="mailbox",
|
id="cabin_outside_mailbox",
|
||||||
name="Mailbox",
|
name="Mailbox",
|
||||||
synonyms=("mailbox", "postbox", "rusty mailbox", "rusty postbox"),
|
synonyms=("mailbox", "postbox", "rusty mailbox", "rusty postbox"),
|
||||||
room_desc="A rusty mailbox sits by the door to the cabin.",
|
room_desc="A rusty mailbox sits by the door to the cabin.",
|
||||||
@@ -191,7 +197,7 @@ database.add_items(
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
Item(
|
Item(
|
||||||
id="west_path",
|
id="cabin_outside_west_path",
|
||||||
name="Western path",
|
name="Western path",
|
||||||
synonyms=(
|
synonyms=(
|
||||||
"path to west",
|
"path to west",
|
||||||
@@ -221,17 +227,73 @@ database.add_items(
|
|||||||
USE: [PrintAction("You head west."), TeleportAction("western_fork")],
|
USE: [PrintAction("You head west."), TeleportAction("western_fork")],
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Item(
|
||||||
|
id="cabin_outside_door",
|
||||||
|
name="Cabin door",
|
||||||
|
room_desc=None,
|
||||||
|
synonyms=("door",),
|
||||||
|
triggers={
|
||||||
|
LOOK: [
|
||||||
|
PrintAction("A strong, sturdy door leading to the inside of the cabin.")
|
||||||
|
],
|
||||||
|
OPEN: [
|
||||||
|
CheckVarAction(
|
||||||
|
var_id="cabin_door_open",
|
||||||
|
yes=PrintAction("The cabin door is already open."),
|
||||||
|
no=[
|
||||||
|
PrintAction("You push the cabin door open."),
|
||||||
|
SetVarAction("cabin_door_open", True),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
CLOSE: [
|
||||||
|
CheckVarAction(
|
||||||
|
var_id="cabin_door_open",
|
||||||
|
yes=[
|
||||||
|
PrintAction("You shut the cabin door tight."),
|
||||||
|
SetVarAction("cabin_door_open", False),
|
||||||
|
],
|
||||||
|
no=PrintAction("The cabin door is already shut."),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
GO: [
|
||||||
|
PrintAction("You step inside the cabin."),
|
||||||
|
TeleportAction("cabin_inside"),
|
||||||
|
],
|
||||||
|
USE: [
|
||||||
|
PrintAction("You step inside the cabin."),
|
||||||
|
TeleportAction("cabin_inside"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Item(
|
||||||
|
id="cabin_outside_inside",
|
||||||
|
name="Cabin",
|
||||||
|
room_desc=None,
|
||||||
|
synonyms=("inside", "inside cabin"),
|
||||||
|
triggers={
|
||||||
|
LOOK: [PrintAction("The cabin is small, but sturdy. A door leads inside.")],
|
||||||
|
GO: [
|
||||||
|
PrintAction("You step inside the cabin."),
|
||||||
|
TeleportAction("cabin_inside"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
database.add_rooms(
|
database.add_rooms(
|
||||||
Room(
|
Room(
|
||||||
id="outside_cabin",
|
id="cabin_outside",
|
||||||
name="Outside the cabin",
|
name="Outside the cabin",
|
||||||
desc=[],
|
desc=[],
|
||||||
items=[
|
items=[
|
||||||
database.items["mailbox"].create_inst(),
|
# Fixtures
|
||||||
|
database.items["cabin_outside_mailbox"].create_inst(),
|
||||||
|
database.items["cabin_outside_west_path"].create_inst(),
|
||||||
|
database.items["cabin_outside_door"].create_inst(),
|
||||||
|
database.items["cabin_outside_inside"].create_inst(),
|
||||||
|
# Items
|
||||||
database.items["anjas_letter"].create_inst(revealed=False),
|
database.items["anjas_letter"].create_inst(revealed=False),
|
||||||
database.items["west_path"].create_inst(),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user