From 1c657f1c63776ecbc57b47ebe329cf10ccc8967d Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sat, 20 Apr 2013 23:07:23 +0300 Subject: Added the final bug tile. ToDo: leave restrictions --- weatbag/tiles/s2e1.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 weatbag/tiles/s2e1.py (limited to 'weatbag/tiles/s2e1.py') diff --git a/weatbag/tiles/s2e1.py b/weatbag/tiles/s2e1.py new file mode 100644 index 0000000..1abc1d1 --- /dev/null +++ b/weatbag/tiles/s2e1.py @@ -0,0 +1,21 @@ +from weatbag import words + +class Tile: + def __init__(self): + self.first_time = True + + def describe(self): + print("You have reached upstream." + "You see the bug.") + + def action(self, player, do): + if (do[0] in words.look) and ('bug' in do): + print("Traceback (most recent call last):\n" + " File \"computergame.py\", line 97397, in matrix.py\n" + "IndexError: list index out of range") + input() + if self.first_time == True: + print("Suddenly, you realize!") + self.first_time = False + input() + print("It's not a bug, it's a feature!") -- cgit v1.3 From 7f5815fd7a5366aa2abc3dc97ffe4512fb290b29 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sat, 20 Apr 2013 23:15:02 +0300 Subject: leave restrictions for s2e1 --- weatbag/tiles/s2e1.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'weatbag/tiles/s2e1.py') diff --git a/weatbag/tiles/s2e1.py b/weatbag/tiles/s2e1.py index 1abc1d1..868d9fc 100644 --- a/weatbag/tiles/s2e1.py +++ b/weatbag/tiles/s2e1.py @@ -19,3 +19,12 @@ class Tile: self.first_time = False input() print("It's not a bug, it's a feature!") + + def leave(self, player, direction): + restricted_directions = { 'w', 'e' } + if direction in restricted_directions: + print("The undergrowth in that direction " + "is impassable. You turn back.") + return False + else: + return True -- cgit v1.3 From 0f3ea1e46f35c04a6b9f38fa238eb3329268770d Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 00:41:18 +0300 Subject: Added extra commands for interacting with bug. --- weatbag/tiles/s2e1.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'weatbag/tiles/s2e1.py') diff --git a/weatbag/tiles/s2e1.py b/weatbag/tiles/s2e1.py index 868d9fc..8924842 100644 --- a/weatbag/tiles/s2e1.py +++ b/weatbag/tiles/s2e1.py @@ -9,7 +9,10 @@ class Tile: "You see the bug.") def action(self, player, do): - if (do[0] in words.look) and ('bug' in do): + if ('bug' in do) and ( do[0] in words.attack or + do[0] in words.look or + do[0] == 'crush' or + do[0] == 'fix' ): print("Traceback (most recent call last):\n" " File \"computergame.py\", line 97397, in matrix.py\n" "IndexError: list index out of range") -- cgit v1.3 From c569846c6c5253911618924afefb7ae549dd9ef6 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 20:38:57 +0300 Subject: Added a comment --- weatbag/tiles/s2e1.py | 1 + 1 file changed, 1 insertion(+) (limited to 'weatbag/tiles/s2e1.py') diff --git a/weatbag/tiles/s2e1.py b/weatbag/tiles/s2e1.py index 8924842..6fd2aec 100644 --- a/weatbag/tiles/s2e1.py +++ b/weatbag/tiles/s2e1.py @@ -1,3 +1,4 @@ +# Second and final bug quest tile. from weatbag import words class Tile: -- cgit v1.3 From 4af6ad330528179fe53b897c880116037b8a51bd Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Mon, 22 Apr 2013 08:14:41 +0300 Subject: Had forgotten to include a restricted direction for the final bug quest tile. --- weatbag/tiles/s2e1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weatbag/tiles/s2e1.py') diff --git a/weatbag/tiles/s2e1.py b/weatbag/tiles/s2e1.py index 6fd2aec..0bd506d 100644 --- a/weatbag/tiles/s2e1.py +++ b/weatbag/tiles/s2e1.py @@ -25,7 +25,7 @@ class Tile: print("It's not a bug, it's a feature!") def leave(self, player, direction): - restricted_directions = { 'w', 'e' } + restricted_directions = { 'w', 'e', 's' } if direction in restricted_directions: print("The undergrowth in that direction " "is impassable. You turn back.") -- cgit v1.3 From fe1ea2ed93eaec1219784e7142f382157bf90f19 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Wed, 24 Apr 2013 17:21:49 +0300 Subject: added comment about entry restrictions on bugquest tiles --- weatbag/tiles/s1e1.py | 5 +++++ weatbag/tiles/s2e1.py | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'weatbag/tiles/s2e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 3e11d37..8a217e0 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -1,4 +1,9 @@ # First bug quest tile. +# +# To future hackers: +# This is part of a short quest which beggins by +# going South from e1. Plase consider this when coding neighbouring tiles. +# thnx :) from weatbag import words import weatbag diff --git a/weatbag/tiles/s2e1.py b/weatbag/tiles/s2e1.py index 0bd506d..42c3b72 100644 --- a/weatbag/tiles/s2e1.py +++ b/weatbag/tiles/s2e1.py @@ -1,4 +1,9 @@ # Second and final bug quest tile. +# +# To future hackers: +# This is part of a short quest which beggins by +# going South from e1. Plase consider this when coding neighbouring tiles. +# thnx :) from weatbag import words class Tile: -- cgit v1.3 From 871d2649c85c56c6b092cffa91a42e2a3210706d Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Wed, 24 Apr 2013 18:44:20 +0300 Subject: editted fake error on bug quest --- weatbag/tiles/s2e1.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'weatbag/tiles/s2e1.py') diff --git a/weatbag/tiles/s2e1.py b/weatbag/tiles/s2e1.py index 42c3b72..f09581f 100644 --- a/weatbag/tiles/s2e1.py +++ b/weatbag/tiles/s2e1.py @@ -20,7 +20,10 @@ class Tile: do[0] == 'crush' or do[0] == 'fix' ): print("Traceback (most recent call last):\n" - " File \"computergame.py\", line 97397, in matrix.py\n" + " File \"matrix.py\", line 97397, in \n" + " main()\n" + " File \"slacking_off.py\", line 23934, in main\n" + " print(excuse[723])\n" "IndexError: list index out of range") input() if self.first_time == True: -- cgit v1.3