From 0e7d8f5218800643115b6d127356949f4574a0e0 Mon Sep 17 00:00:00 2001 From: Julian Irwin Date: Tue, 8 Jan 2013 21:32:24 -0600 Subject: Added s2 (basically stub). I plan to add some adventures in this direction. --- weatbag/tiles/s1.py | 2 +- weatbag/tiles/s2.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 weatbag/tiles/s2.py diff --git a/weatbag/tiles/s1.py b/weatbag/tiles/s1.py index efdc041..c12ac9b 100644 --- a/weatbag/tiles/s1.py +++ b/weatbag/tiles/s1.py @@ -1,6 +1,6 @@ class Tile: def describe(self): - print("You push through the undergrowth - there's hardly a path here at all.") + print("You push through the undergrowth - the path is overgrown but continues on..") def action(self, player, do): # Nothing to do here yet. diff --git a/weatbag/tiles/s2.py b/weatbag/tiles/s2.py new file mode 100644 index 0000000..59f66e2 --- /dev/null +++ b/weatbag/tiles/s2.py @@ -0,0 +1,11 @@ + +from weatbag import words + +class Tile: + def describe(self): + print( "The foliage along the path begins to thin and you " + "notice that you are now climbing a gentle slope.") + + def action(self, player, do): + # Nothing to do here yet. + print("Sorry, I don't understand") -- cgit v1.3 From 31ee9408bd3f8510ded20755f5a56cd6404aea73 Mon Sep 17 00:00:00 2001 From: Julian Irwin Date: Wed, 9 Jan 2013 00:08:31 -0600 Subject: Fleshed out s2 --- weatbag/tiles/s2.py | 34 ++++++++++++++++++++++++++++------ weatbag/tiles/s3.py | 10 ++++++++++ 2 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 weatbag/tiles/s3.py diff --git a/weatbag/tiles/s2.py b/weatbag/tiles/s2.py index 59f66e2..85e94c6 100644 --- a/weatbag/tiles/s2.py +++ b/weatbag/tiles/s2.py @@ -2,10 +2,32 @@ from weatbag import words class Tile: - def describe(self): - print( "The foliage along the path begins to thin and you " - "notice that you are now climbing a gentle slope.") + + def describe(self): + print("The foliage begins to thin and the path winds forwards " + "up a steep hillside. A rugged granite rockformation tops " + "the hill, its centerpiece two slabs of rock leaning together " + "to form a crude arch. Nondescript fields lie to the " + "East and West.") - def action(self, player, do): - # Nothing to do here yet. - print("Sorry, I don't understand") + def action(self, player, do): + # Nothing to do here yet. + print("Sorry, I don't understand") + + # Used for more colorfull invisible wall messages in leave. + wrong_direction_counter = 0 + + # Only allow movement to south, norht + def leave(self, player, direction): + if direction is 'e' or 'w': + if self.wrong_direction_counter <=1 : + print("There's nothing but non-descript fields over here. Better " + "not leave the path.") + else: + print("You spend an hour wandering through the field and confirm that " + "it is indeed nondescript. Upon returning to the path, the hilltop " + "appears ever more alluring.") + self.wrong_direction_counter += 1 + return False + else: + return True diff --git a/weatbag/tiles/s3.py b/weatbag/tiles/s3.py new file mode 100644 index 0000000..1f377f1 --- /dev/null +++ b/weatbag/tiles/s3.py @@ -0,0 +1,10 @@ +from weatbag import words + +class Tile: + def describe(self): + print( "The foliage along the path begins to thin and you " + "notice that you are now climbing a gentle slope.") + + def action(self, player, do): + # Nothing to do here yet. + print("Sorry, I don't understand") -- cgit v1.3 From 1bec3009e4d30e7e7c6854103d2688aa2059ebf5 Mon Sep 17 00:00:00 2001 From: Julian Irwin Date: Thu, 10 Jan 2013 13:48:33 -0600 Subject: Half way done with s3 --- weatbag/tiles/.s3.py.swp | Bin 0 -> 12288 bytes weatbag/tiles/s2.py | 23 +++--------------- weatbag/tiles/s3.py | 62 ++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 59 insertions(+), 26 deletions(-) create mode 100644 weatbag/tiles/.s3.py.swp diff --git a/weatbag/tiles/.s3.py.swp b/weatbag/tiles/.s3.py.swp new file mode 100644 index 0000000..8438c10 Binary files /dev/null and b/weatbag/tiles/.s3.py.swp differ diff --git a/weatbag/tiles/s2.py b/weatbag/tiles/s2.py index 85e94c6..a66aa98 100644 --- a/weatbag/tiles/s2.py +++ b/weatbag/tiles/s2.py @@ -4,30 +4,13 @@ from weatbag import words class Tile: def describe(self): - print("The foliage begins to thin and the path winds forwards " + print("To the South, the foliage begins to thin and the path winds forwards " "up a steep hillside. A rugged granite rockformation tops " "the hill, its centerpiece two slabs of rock leaning together " - "to form a crude arch. Nondescript fields lie to the " - "East and West.") + "to form a crude arch." ) def action(self, player, do): # Nothing to do here yet. print("Sorry, I don't understand") - # Used for more colorfull invisible wall messages in leave. - wrong_direction_counter = 0 - - # Only allow movement to south, norht - def leave(self, player, direction): - if direction is 'e' or 'w': - if self.wrong_direction_counter <=1 : - print("There's nothing but non-descript fields over here. Better " - "not leave the path.") - else: - print("You spend an hour wandering through the field and confirm that " - "it is indeed nondescript. Upon returning to the path, the hilltop " - "appears ever more alluring.") - self.wrong_direction_counter += 1 - return False - else: - return True + diff --git a/weatbag/tiles/s3.py b/weatbag/tiles/s3.py index 1f377f1..c44bfc6 100644 --- a/weatbag/tiles/s3.py +++ b/weatbag/tiles/s3.py @@ -1,10 +1,60 @@ from weatbag import words class Tile: - def describe(self): - print( "The foliage along the path begins to thin and you " - "notice that you are now climbing a gentle slope.") + def __init__(self): + self.short_man_gone = False + self.short_man_life = 2 + self.pants_on_fire = False - def action(self, player, do): - # Nothing to do here yet. - print("Sorry, I don't understand") + def describe(self): + print( "You reach the top of the hill and look around the rock " + "formations. You find nothing but dust, a mud puddle, and" + "withered shrubs.\n") + if not self.short_man_gone: + self.pants_on_fire = True + print( "Just as you are returning to the path, a ball of fire " + "hurtles through the air and explodes at your feet, setting " + "your pants on fire. You hear high pitched cackling and " + "snorting.\n") + else: + print( "You see the charred ground, " + "reminding you of your encounter with the short man who set " + "your pants on fire. That was a close one. There is a steep " + "path leading down the hill to the North. To the south, the " + "hiltop path continues.\n") + + + def action(self, player, do): + if self.pants_on_fire: + self.action_pants_on_fire(player, do) + + elif not self.short_man_gone: + self.action_short_man(player, do) + + elif self.short_man_gone: + print("I'm sorry, I don't understand.") + + + + def action_pants_on_fire(self, player, do): + if do.count('roll') > 0: + self.pants_on_fire = False + print("Wisely following the teachings of your elders, you freeze, " + "drop to the ground and roll around until the fire is " + "extinguished. Covered in dirt and pants in tatters, you " + "stand up and face your assailant, a short man.") + elif do.count('puddle') > 0: + self.pants_on_fire = False + print("You dash over the the mud puddle and splash water on your " + "legs until the fire is quenched. Covered in mud and pants " + "in taters, you stand up and face your assailant, a short man.") + else: + print("You had better find a way to put out this fire. Your legs " + "are beginning to burn!") + + + def action_short_man(self, player, do): + print("Not done yet.") + return + + -- cgit v1.3 From 1347f437e66a18a340abc3bfe487cd42b5f7f9c8 Mon Sep 17 00:00:00 2001 From: Julian Irwin Date: Sat, 26 Jan 2013 13:37:41 -0500 Subject: Finished s3 encounter w/ short man --- weatbag/tiles/s1.py | 2 +- weatbag/tiles/s3.py | 58 ++++++++++++++++++++++++++++++++++++++++------------- weatbag/words.py | 1 + 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/weatbag/tiles/s1.py b/weatbag/tiles/s1.py index c12ac9b..4e50936 100644 --- a/weatbag/tiles/s1.py +++ b/weatbag/tiles/s1.py @@ -1,6 +1,6 @@ class Tile: def describe(self): - print("You push through the undergrowth - the path is overgrown but continues on..") + print("You push through the undergrowth - the path is overgrown but continues on...") def action(self, player, do): # Nothing to do here yet. diff --git a/weatbag/tiles/s3.py b/weatbag/tiles/s3.py index c44bfc6..abd2a98 100644 --- a/weatbag/tiles/s3.py +++ b/weatbag/tiles/s3.py @@ -2,19 +2,19 @@ from weatbag import words class Tile: def __init__(self): - self.short_man_gone = False - self.short_man_life = 2 + self.short_man_here = True self.pants_on_fire = False + self.talk_or_fight = None def describe(self): print( "You reach the top of the hill and look around the rock " "formations. You find nothing but dust, a mud puddle, and" "withered shrubs.\n") - if not self.short_man_gone: + if self.short_man_here: self.pants_on_fire = True print( "Just as you are returning to the path, a ball of fire " "hurtles through the air and explodes at your feet, setting " - "your pants on fire. You hear high pitched cackling and " + "one of your pant legs on fire. You hear high pitched cackling and " "snorting.\n") else: print( "You see the charred ground, " @@ -28,33 +28,63 @@ class Tile: if self.pants_on_fire: self.action_pants_on_fire(player, do) - elif not self.short_man_gone: + elif self.short_man_here: self.action_short_man(player, do) elif self.short_man_gone: print("I'm sorry, I don't understand.") - + + def leave(self, player, direction): + if self.pants_on_fire: + print("Running now will only feed the fire!") + return False + elif self.short_man_here: + print("This fellow is dangerous. I better not turn my back on him.") + return False + else: + return True def action_pants_on_fire(self, player, do): - if do.count('roll') > 0: + if 'roll' in do: self.pants_on_fire = False print("Wisely following the teachings of your elders, you freeze, " "drop to the ground and roll around until the fire is " - "extinguished. Covered in dirt and pants in tatters, you " - "stand up and face your assailant, a short man.") - elif do.count('puddle') > 0: + "extinguished. Covered in dirt and pantleg in tatters, you " + "stand up and face your assailant, a rather short man " + "with pale skin and bushy orange hair." + "Do you talk to him or rush him?") + + elif 'puddle' in do: self.pants_on_fire = False print("You dash over the the mud puddle and splash water on your " - "legs until the fire is quenched. Covered in mud and pants " - "in taters, you stand up and face your assailant, a short man.") + "legs until the fire is quenched. Covered in mud and pantleg" + "in taters, you stand up and face your assailant, a rather short man " + "with pale skin and bushy orange hair." + "Do you talk to him or attack him?") else: print("You had better find a way to put out this fire. Your legs " "are beginning to burn!") def action_short_man(self, player, do): - print("Not done yet.") - return + if do[0] in words.attack: + print("Not one to be played around with, you charge the man. His amusement " + "quickly turns to surprise and then fear as your size and " + "determination become apparent. The man stumbles backwards and emits " + "a yelp. Just before he hits the groud there is a dry popping noise " + "a flash of light and the man is gone. ") + elif do[0] in words.talk: + print("\"What the hell was that?\" you growl.\n" + "The man jumps deftly onto a boulder, looks at you over his " + "shoulder for just a moment, and then jumps out of sight. " + "You quickly climb after him, but he has somehow disappeared.") + self.short_man_here = False + + + + + + diff --git a/weatbag/words.py b/weatbag/words.py index 94d2134..adaa012 100644 --- a/weatbag/words.py +++ b/weatbag/words.py @@ -16,6 +16,7 @@ take = {'pick', 'take', 'get', 'collect'} look = {'look', 'inspect', 'examine'} attack = {'attack', 'swing', 'hit', 'punch', 'fight'} combine = {'combine', 'join', 'mix'} +talk = {'talk', 'speak', 'converse'} # Nouns inventory = {'inventory', 'possessions', 'belongings', 'bag'} -- cgit v1.3 From fb2bfc0966aac9833a37e44564a35a3c7631dc6f Mon Sep 17 00:00:00 2001 From: Julian Irwin Date: Sun, 27 Jan 2013 13:07:46 -0500 Subject: Made changes recommended by takluyver --- .gitignore | 1 + weatbag/tiles/.s3.py.swp | Bin 12288 -> 0 bytes weatbag/tiles/s3.py | 23 +++++++++++++---------- 3 files changed, 14 insertions(+), 10 deletions(-) delete mode 100644 weatbag/tiles/.s3.py.swp diff --git a/.gitignore b/.gitignore index 4a4b669..e40b52d 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ nosetests.xml .mr.developer.cfg .project .pydevproject + diff --git a/weatbag/tiles/.s3.py.swp b/weatbag/tiles/.s3.py.swp deleted file mode 100644 index 8438c10..0000000 Binary files a/weatbag/tiles/.s3.py.swp and /dev/null differ diff --git a/weatbag/tiles/s3.py b/weatbag/tiles/s3.py index abd2a98..657f4a3 100644 --- a/weatbag/tiles/s3.py +++ b/weatbag/tiles/s3.py @@ -4,24 +4,24 @@ class Tile: def __init__(self): self.short_man_here = True self.pants_on_fire = False - self.talk_or_fight = None def describe(self): - print( "You reach the top of the hill and look around the rock " - "formations. You find nothing but dust, a mud puddle, and" - "withered shrubs.\n") + print( "You reach the top of the hill, pass through the arch " + "and look around the rock " + "formations. You find nothing but dust, a mud puddle, and " + "withered shrubs.") if self.short_man_here: self.pants_on_fire = True print( "Just as you are returning to the path, a ball of fire " "hurtles through the air and explodes at your feet, setting " "one of your pant legs on fire. You hear high pitched cackling and " - "snorting.\n") + "snorting.") else: print( "You see the charred ground, " "reminding you of your encounter with the short man who set " "your pants on fire. That was a close one. There is a steep " "path leading down the hill to the North. To the south, the " - "hiltop path continues.\n") + "hiltop path continues.") def action(self, player, do): @@ -30,8 +30,8 @@ class Tile: elif self.short_man_here: self.action_short_man(player, do) - - elif self.short_man_gone: + + else: print("I'm sorry, I don't understand.") def leave(self, player, direction): @@ -39,7 +39,7 @@ class Tile: print("Running now will only feed the fire!") return False elif self.short_man_here: - print("This fellow is dangerous. I better not turn my back on him.") + print("This fellow is dangerous. I'd better not turn my back on him.") return False else: return True @@ -69,17 +69,20 @@ class Tile: def action_short_man(self, player, do): if do[0] in words.attack: + self.short_man_here = False print("Not one to be played around with, you charge the man. His amusement " "quickly turns to surprise and then fear as your size and " "determination become apparent. The man stumbles backwards and emits " "a yelp. Just before he hits the groud there is a dry popping noise " "a flash of light and the man is gone. ") elif do[0] in words.talk: + self.short_man_here = False print("\"What the hell was that?\" you growl.\n" "The man jumps deftly onto a boulder, looks at you over his " "shoulder for just a moment, and then jumps out of sight. " "You quickly climb after him, but he has somehow disappeared.") - self.short_man_here = False + else: + print("I'm sorry, I don't understand.") -- cgit v1.3