Skip to content

Commit 21060e6

Browse files
committed
add basic interaction with self
1 parent b7d6d50 commit 21060e6

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/world.ron

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(player: "PLAYER", items: {
22
"PLAYER": (
3+
names: ["self", "myself"],
34
locations: ["BRIG"],
45
hp: 10,
56
),

tests/test.rs

+10
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,15 @@ mod tests {
151151
"You hit the goblin with your spear. It dies. It drops a dagger."
152152
);
153153
assert_eq!(game.ask("take dagger"), "Taken.");
154+
155+
// hit self
156+
assert_eq!(
157+
game.ask("hit self with the spear"),
158+
"You hit the self with your spear."
159+
);
160+
assert_eq!(
161+
game.ask("hit myself with my dagger"),
162+
"You hit the self with your dagger."
163+
);
154164
}
155165
}

tests/world.ron

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(player: "PLAYER", items: {
22
"PLAYER": (
3+
names: ["self", "myself"],
34
locations: ["CENTER ROOM"],
45
hp: 10,
56
),

0 commit comments

Comments
 (0)