From 3541efc01e9519743ba96a798f39ca03b352493c Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sat, 20 Apr 2013 01:23:16 +0300 Subject: Added first bug tile. --- weatbag/tiles/s1e1.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 weatbag/tiles/s1e1.py (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py new file mode 100644 index 0000000..9f96e6b --- /dev/null +++ b/weatbag/tiles/s1e1.py @@ -0,0 +1,21 @@ +from weatbag import words +import weatbag + +class Tile: + def __init__(self): + self.contents = {'bug': 1} + pass + + def describe(self): + print("There is a stream here.\n" + "It runs from South to North.") + + if self.contents['bug'] > 0: + print("You see a huge ugly bug rush past you, " + "following the river south.") + self.contents['bug'] -= 1 + else: + print("You remember this is where you saw that bug going south") + + def action(self, player, do): + pass -- cgit v1.3 From dc0b9a548f9a78f3beeb5989f0682b0a819b5594 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sat, 20 Apr 2013 01:27:24 +0300 Subject: Fixed leave bug in s1e1 and modified output text. --- weatbag/tiles/s1e1.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 9f96e6b..74a0aa0 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -11,11 +11,19 @@ class Tile: "It runs from South to North.") if self.contents['bug'] > 0: - print("You see a huge ugly bug rush past you, " + print("You see a huge, ugly bug rush past you, " "following the river south.") self.contents['bug'] -= 1 else: - print("You remember this is where you saw that bug going south") + print("You remember this is where you saw that bug going south.") def action(self, player, do): pass + + def leave(self, player, direction): + if direction == 's': + print("Bugs are the enemy and must be crushed!" + "So you decide to follow the bug upstream.") + return True + else: + return True -- cgit v1.3 From b69c7bfa3d7d40c1c9d91ff424194a14e4e2a62f Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sat, 20 Apr 2013 01:38:26 +0300 Subject: Added leave text if not going after the bug. --- weatbag/tiles/s1e1.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 74a0aa0..ff09753 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -4,26 +4,32 @@ import weatbag class Tile: def __init__(self): self.contents = {'bug': 1} + self.bug_leaves_this_time = True pass def describe(self): - print("There is a stream here.\n" + print("There is a stream here. " "It runs from South to North.") if self.contents['bug'] > 0: print("You see a huge, ugly bug rush past you, " - "following the river south.") + "following the river South.") self.contents['bug'] -= 1 else: - print("You remember this is where you saw that bug going south.") + print("You remember this is where you saw that bug going South.") def action(self, player, do): pass def leave(self, player, direction): if direction == 's': - print("Bugs are the enemy and must be crushed!" + print("Bugs are the enemy and must be crushed!\n" "So you decide to follow the bug upstream.") return True else: + if self.bug_leaves_this_time: + print("Bugs do not interest you very much.\n" + "Lets get out of here.") + self.bug_leaves_this_time = False + input() return True -- cgit v1.3 From bd2a553a492a19dfc122faeb64a441358a13ee31 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sat, 20 Apr 2013 21:29:48 +0300 Subject: added a pause after leave text --- weatbag/tiles/s1e1.py | 1 + 1 file changed, 1 insertion(+) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index ff09753..a046343 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -25,6 +25,7 @@ class Tile: if direction == 's': print("Bugs are the enemy and must be crushed!\n" "So you decide to follow the bug upstream.") + input() return True else: if self.bug_leaves_this_time: -- cgit v1.3 From 7635811fbb0e4d942394272f1bfee728fd8ebdeb Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sat, 20 Apr 2013 21:30:49 +0300 Subject: wrong indentation on previous commit --- weatbag/tiles/s1e1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index a046343..ad98ad1 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -25,7 +25,7 @@ class Tile: if direction == 's': print("Bugs are the enemy and must be crushed!\n" "So you decide to follow the bug upstream.") - input() + input() return True else: if self.bug_leaves_this_time: -- cgit v1.3 From d6160c24f1d610a0dcf8051ece77b9c5b25e86a1 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sat, 20 Apr 2013 23:22:27 +0300 Subject: leave restrictions for s2e1 --- weatbag/tiles/s1e1.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index ad98ad1..f44f4cd 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -22,7 +22,12 @@ class Tile: pass def leave(self, player, direction): - if direction == 's': + restricted_directions = { 'w', 'e' } + if direction in restricted_directions: + print("The undergrowth in that direction " + "is impassable. You turn back.") + return False + elif direction == 's': print("Bugs are the enemy and must be crushed!\n" "So you decide to follow the bug upstream.") input() -- cgit v1.3 From 645d51c6c5702313448520513be97433130725bd Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 05:10:22 +0300 Subject: fixed bug_quest exit message. --- weatbag/tiles/s1e1.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index f44f4cd..86b4758 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -4,7 +4,7 @@ import weatbag class Tile: def __init__(self): self.contents = {'bug': 1} - self.bug_leaves_this_time = True + self.first_visit = True pass def describe(self): @@ -31,11 +31,12 @@ class Tile: print("Bugs are the enemy and must be crushed!\n" "So you decide to follow the bug upstream.") input() + self.first_visit = False return True else: - if self.bug_leaves_this_time: + if self.first_visit: print("Bugs do not interest you very much.\n" "Lets get out of here.") - self.bug_leaves_this_time = False + self.first_visit = False input() return True -- cgit v1.3 From b6494a43397a58d4861d715c737b299c9e8fe09b Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 20:18:27 +0300 Subject: Added check for "bugs must be crushed" message. Now the message shows up only the first time the player goes South. --- weatbag/tiles/s1e1.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 86b4758..5dabe3c 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -5,6 +5,7 @@ class Tile: def __init__(self): self.contents = {'bug': 1} self.first_visit = True + self.hasnt_gone_south = True pass def describe(self): @@ -27,11 +28,12 @@ class Tile: print("The undergrowth in that direction " "is impassable. You turn back.") return False - elif direction == 's': + elif direction == 's' and hasnt_gone_south: print("Bugs are the enemy and must be crushed!\n" "So you decide to follow the bug upstream.") input() self.first_visit = False + self.hasnt_gone_south = False return True else: if self.first_visit: -- cgit v1.3 From 69cba96ca9d026467f3c98a1b8139ae0340e9669 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 20:24:16 +0300 Subject: added some comments --- weatbag/tiles/s1e1.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 5dabe3c..a29c2d2 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -1,3 +1,4 @@ +# First bug quest tile. from weatbag import words import weatbag @@ -19,9 +20,13 @@ class Tile: else: print("You remember this is where you saw that bug going South.") + # Nothing to do here. def action(self, player, do): pass + # Player can only exit the bug quest going back North. + # Player gets different messages the first time he + # exits this tile, depending on his direction. def leave(self, player, direction): restricted_directions = { 'w', 'e' } if direction in restricted_directions: -- cgit v1.3 From 5774fb83d9139831a5cf1fb0cc6ff3f475d3d9ff Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 20:26:56 +0300 Subject: Changed They way I check for bug presence. It's simpler and more readable now. --- weatbag/tiles/s1e1.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index a29c2d2..854bedd 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -4,7 +4,7 @@ import weatbag class Tile: def __init__(self): - self.contents = {'bug': 1} + self.bug_is_here = True self.first_visit = True self.hasnt_gone_south = True pass @@ -13,10 +13,10 @@ class Tile: print("There is a stream here. " "It runs from South to North.") - if self.contents['bug'] > 0: + if self.bug_is_here: print("You see a huge, ugly bug rush past you, " "following the river South.") - self.contents['bug'] -= 1 + self.bug_is_here = False else: print("You remember this is where you saw that bug going South.") -- cgit v1.3 From 3632fc802ba9c537653e633b12d9430c7ed3f0b6 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 20:30:54 +0300 Subject: Made a sexist comment more PC. --- weatbag/tiles/s1e1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 854bedd..4bb551d 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -26,7 +26,7 @@ class Tile: # Player can only exit the bug quest going back North. # Player gets different messages the first time he - # exits this tile, depending on his direction. + # exits this tile, depending on their direction. def leave(self, player, direction): restricted_directions = { 'w', 'e' } if direction in restricted_directions: -- cgit v1.3 From 2e8956d6401daef2793724dfb981e6b41d685457 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 20:40:57 +0300 Subject: Revert "Made a sexist comment more PC." This reverts commit 3632fc802ba9c537653e633b12d9430c7ed3f0b6. --- weatbag/tiles/s1e1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 4bb551d..854bedd 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -26,7 +26,7 @@ class Tile: # Player can only exit the bug quest going back North. # Player gets different messages the first time he - # exits this tile, depending on their direction. + # exits this tile, depending on his direction. def leave(self, player, direction): restricted_directions = { 'w', 'e' } if direction in restricted_directions: -- cgit v1.3 From 2d11dd35211650214ac13a2635d54ac9b615f577 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 21 Apr 2013 20:42:16 +0300 Subject: Made a sexist comment more PC. --- weatbag/tiles/s1e1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 854bedd..1db29e3 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -25,8 +25,8 @@ class Tile: pass # Player can only exit the bug quest going back North. - # Player gets different messages the first time he - # exits this tile, depending on his direction. + # Player gets different messages the first time they + # exit this tile, depending on their direction. def leave(self, player, direction): restricted_directions = { 'w', 'e' } if direction in restricted_directions: -- cgit v1.3 From 107257df0d103c879d1b7d39bbee9789051545e4 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Mon, 22 Apr 2013 07:28:01 +0300 Subject: forgot to write 'self.' before a variable --- weatbag/tiles/s1e1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weatbag/tiles/s1e1.py') diff --git a/weatbag/tiles/s1e1.py b/weatbag/tiles/s1e1.py index 1db29e3..3e11d37 100644 --- a/weatbag/tiles/s1e1.py +++ b/weatbag/tiles/s1e1.py @@ -33,7 +33,7 @@ class Tile: print("The undergrowth in that direction " "is impassable. You turn back.") return False - elif direction == 's' and hasnt_gone_south: + elif direction == 's' and self.hasnt_gone_south: print("Bugs are the enemy and must be crushed!\n" "So you decide to follow the bug upstream.") input() -- 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/s1e1.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