def generate_food_sentence(self, c): high_food_sentences = ['We have a lot of food', 'Our supplies should last a while', 'We have food for many days', "Let's continue, we don't have to worry about food", "We are well supplied"] medium_food_sentences = ["Our food should last a bit longer", "We have food to last several days", "Our supplies are in decent shape", "We have a good amount of food"] low_food_sentences = ["We are running low on food", "We should consider searching for supplies", "We're running out of supplies", "Our food will last only a few more days"] no_food_sentences = ["Our food is all gone", "We're out of food", "Our supplies have run out", "We need to hunt for food", "I'm starving"] if self.level(self.food) == 'high': return says_sentence(c, random.choice(high_food_sentences)) elif self.level(self.food) == 'medium': return says_sentence(c, random.choice(medium_food_sentences)) elif self.level(self.food) == 'low': return says_sentence(c, random.choice(low_food_sentences)) else: return says_sentence(c, random.choice(no_food_sentences))
def generate_sentences(self): c1 = random.choice(self.state.get_characters()) c = random.choice(self.state.get_characters()) others = [char for char in self.state.get_characters() if char.get_name() != c.get_name()] md_writer.print_chapter_sentence(self.state.generate_food_sentence(c1)) md_writer.print_chapter_sentence(c.get_name() + ' decided to go ' + self.method + '.') memory = c.get_memory(self.method) if memory != None: md_writer.print_chapter_sentence(memory) food = 0 if self.method == 'hunting': food = self.hunting(c) elif self.method == 'searching for food': food = self.searching(c) else: food = self.fishing(c) if food > 0: md_writer.print_chapter_sentence(c.get_name() + ' returned to ' + others[0].get_name() + ' with ' + c.get_possessive_pronoun() + ' food.') md_writer.print_chapter_sentence(says_sentence(others[0], 'Great job ' + c.get_name())) c.set_positive_quality() else: md_writer.print_chapter_sentence(c.get_name() + ' returned to ' + others[0].get_name() + ' empty handed.') md_writer.print_chapter_sentence(says_sentence(c, "We will have to just keep going, there was no food to find here")) if random.random() < 0.5: c.set_negative_quality() self.state.add_food(food)
def generate_energy_sentence(self, c): high_energy_sentences = ['', 'We should keep moving, before we get tired', 'I feel refreshed', "I feel energized", "Let's hurry"] medium_energy_sentences = ["Let's keep moving", "I'm not tired yet", "We should keep going for a while", "Let's not camp yet"] low_energy_sentences = ["I'm getting tired", "We should make camp soon", "You're looking tired", "I'm feeling rather sleepy"] no_energy_sentences = ["I'm exhausted", "Let's make camp now", "We should find a suitable place to camp", "Let's take a break", "Argh! I'm so tired"] if self.level(self.energy) == 'high': return says_sentence(c, random.choice(high_energy_sentences)) elif self.level(self.energy) == 'medium': return says_sentence(c, random.choice(medium_energy_sentences)) elif self.level(self.food) == 'low': return says_sentence(c, random.choice(low_energy_sentences)) else: return says_sentence(c, random.choice(no_energy_sentences))
def generate_food_sentence(self, c): high_food_sentences = [ 'We have a lot of food', 'Our supplies should last a while', 'We have food for many days', "Let's continue, we don't have to worry about food", "We are well supplied" ] medium_food_sentences = [ "Our food should last a bit longer", "We have food to last several days", "Our supplies are in decent shape", "We have a good amount of food" ] low_food_sentences = [ "We are running low on food", "We should consider searching for supplies", "We're running out of supplies", "Our food will last only a few more days" ] no_food_sentences = [ "Our food is all gone", "We're out of food", "Our supplies have run out", "We need to hunt for food", "I'm starving" ] if self.level(self.food) == 'high': return says_sentence(c, random.choice(high_food_sentences)) elif self.level(self.food) == 'medium': return says_sentence(c, random.choice(medium_food_sentences)) elif self.level(self.food) == 'low': return says_sentence(c, random.choice(low_food_sentences)) else: return says_sentence(c, random.choice(no_food_sentences))
def generate_energy_sentence(self, c): high_energy_sentences = [ '', 'We should keep moving, before we get tired', 'I feel refreshed', "I feel energized", "Let's hurry" ] medium_energy_sentences = [ "Let's keep moving", "I'm not tired yet", "We should keep going for a while", "Let's not camp yet" ] low_energy_sentences = [ "I'm getting tired", "We should make camp soon", "You're looking tired", "I'm feeling rather sleepy" ] no_energy_sentences = [ "I'm exhausted", "Let's make camp now", "We should find a suitable place to camp", "Let's take a break", "Argh! I'm so tired" ] if self.level(self.energy) == 'high': return says_sentence(c, random.choice(high_energy_sentences)) elif self.level(self.energy) == 'medium': return says_sentence(c, random.choice(medium_energy_sentences)) elif self.level(self.food) == 'low': return says_sentence(c, random.choice(low_energy_sentences)) else: return says_sentence(c, random.choice(no_energy_sentences))
def generate_lore_sentence(self, state): c = random.choice(self.state.get_characters()) if c.challenge('lore'): return says_sentence( c, self.state.get_current_setting().discover_lore()) else: return says_sentence(c, random.choice(lore_fail_exclamations))
def generate_enemy_sentence(self, c): followed_sentences = ['I just heard something move', "I think we are being followed", "I have a bad feeling", "I saw something move", "I thought I saw something over there"] not_followed_sentences = ["It's so peaceful here", "It is so quiet", "I think we're alone", "It's very quiet here"] if len(self.enemy_patrols) > 0: return says_sentence(c, random.choice(followed_sentences)) else: return says_sentence(c, random.choice(not_followed_sentences))
def generate_enemy_sentence(self, c): followed_sentences = [ 'I just heard something move', "I think we are being followed", "I have a bad feeling", "I saw something move", "I thought I saw something over there" ] not_followed_sentences = [ "It's so peaceful here", "It is so quiet", "I think we're alone", "It's very quiet here" ] if len(self.enemy_patrols) > 0: return says_sentence(c, random.choice(followed_sentences)) else: return says_sentence(c, random.choice(not_followed_sentences))
def generate_injury_sentence(self, c): if len(c.get_injuries()) > 0: injury = random.choice(c.get_injuries()) return says_sentence(c, 'My ' + injury.get_description() + ' hurts') else: return self.get_current_setting().mood_sentence()
def generate_sentences(self): c1 = random.choice(self.state.get_characters()) c = random.choice(self.state.get_characters()) others = [ char for char in self.state.get_characters() if char.get_name() != c.get_name() ] md_writer.print_chapter_sentence(self.state.generate_food_sentence(c1)) md_writer.print_chapter_sentence(c.get_name() + ' decided to go ' + self.method + '.') memory = c.get_memory(self.method) if memory != None: md_writer.print_chapter_sentence(memory) food = 0 if self.method == 'hunting': food = self.hunting(c) elif self.method == 'searching for food': food = self.searching(c) else: food = self.fishing(c) if food > 0: md_writer.print_chapter_sentence(c.get_name() + ' returned to ' + others[0].get_name() + ' with ' + c.get_possessive_pronoun() + ' food.') md_writer.print_chapter_sentence( says_sentence(others[0], 'Great job ' + c.get_name())) c.set_positive_quality() else: md_writer.print_chapter_sentence(c.get_name() + ' returned to ' + others[0].get_name() + ' empty handed.') md_writer.print_chapter_sentence( says_sentence( c, "We will have to just keep going, there was no food to find here" )) if random.random() < 0.5: c.set_negative_quality() self.state.add_food(food)
def searching(self, c): # Find a place to search for food food = random.choice([ 'bird eggs', 'wild barley', 'berries', 'mushrooms', 'almonds', 'chickpeas', 'wild carrots', 'olives', 'apples', 'bananas', 'avocados' ]) md_writer.print_chapter_sentence(c.get_name() + ' went searching for ' + food + '.') if c.challenge('survival'): md_writer.print_chapter_sentence( c.get_pronoun().title() + ' looked around the ' + self.state.get_current_setting().get_name() + ' for ' + food + '.') else: md_writer.print_chapter_sentence('After a lengthy search, ' + c.get_pronoun() + ' gave up - no ' + food + ' were to be found here.') return 0 if random.random() < 0.05: md_writer.print_chapter_sentence( self.state.get_current_setting().mood_sentence()) # Gather the food if c.challenge('survival'): md_writer.print_chapter_sentence(c.get_name() + ' filled ' + c.get_possessive_pronoun() + ' arms with ' + food + '.') else: md_writer.print_chapter_sentence(c.get_name() + ' tasted the ' + food + '.') taste = random.choice( ['bitter', 'disgusting', 'sour', 'dizzying', 'gross', 'fiery']) md_writer.print_chapter_sentence('It was ' + taste + '.') md_writer.print_chapter_sentence( says_sentence(c, 'Must be poisonous')) return 0 return random.randint(7, 15)
def searching(self, c): # Find a place to search for food food = random.choice(['bird eggs', 'wild barley', 'berries', 'mushrooms', 'almonds', 'chickpeas', 'wild carrots', 'olives', 'apples', 'bananas', 'avocados']) md_writer.print_chapter_sentence(c.get_name() + ' went searching for ' + food + '.') if c.challenge('survival'): md_writer.print_chapter_sentence(c.get_pronoun().title() + ' looked around the ' + self.state.get_current_setting().get_name() + ' for ' + food + '.') else: md_writer.print_chapter_sentence('After a lengthy search, ' + c.get_pronoun() + ' gave up - no ' + food + ' were to be found here.') return 0 if random.random() < 0.05: md_writer.print_chapter_sentence(self.state.get_current_setting().mood_sentence()) # Gather the food if c.challenge('survival'): md_writer.print_chapter_sentence(c.get_name() + ' filled ' + c.get_possessive_pronoun() + ' arms with ' + food + '.') else: md_writer.print_chapter_sentence(c.get_name() + ' tasted the ' + food + '.') taste = random.choice(['bitter', 'disgusting', 'sour', 'dizzying', 'gross', 'fiery']) md_writer.print_chapter_sentence('It was ' + taste + '.') md_writer.print_chapter_sentence(says_sentence(c, 'Must be poisonous')) return 0 return random.randint(7, 15)
def generate_lore_sentence(self, state): c = random.choice(self.state.get_characters()) if c.challenge('lore'): return says_sentence(c, self.state.get_current_setting().discover_lore()) else: return says_sentence(c, random.choice(lore_fail_exclamations))