import os from game import Game a = Game() def intro(): a.clear() a.ask("What is your name?\n") a.response() a.name = a.answer a.ask("Is your name really %s?\n" % (a.name)) a.response() if a.answer.lower() == "yes": print("It is a weak name, I suppose it befits a whelp like you.") else: a.name=(input("Well, then what is it? The next thing you utter shall be what you will be known as!\n")) a.expEnter() a.clear() print("Truth be told, I'm quite surprised that you remember your name at all. You were in a pretty sorry state when you were dragged in here.") a.expEnter() a.clear() print("You were bleeding something fierce...those gruesome gashes all over your body. It's like something toyed with you and got bored before finishing the job.") a.orig_attacker=(input("What the hell put you in that state?\n")) a.clear() print("%s...hm...never seen that happen to anyone 'round here before." % (a.orig_attacker)) a.expEnter() a.clear() a.lover=input("You were muttering someone's name in your sleep. The way you was moanin it made me pretty sure you've got someone special. Didn't quite catch the name though, who's yer special friend?\n") a.clear() print("Well, if you want to see that %s again, you'll have to get a move on." % (a.lover)) print("There isn't much time to spare. I wish I could explain what's going on around here, but every minute we tarry, they're getting cloer.") print("I don't have much to spare but I'll be damned to see you get chopped to bits right after I've nursed you back to health.") print("Here's a spare health potion, but that won't keep you alive for long if you can't protect yerself from things like %s." % (a.orig_attacker)) a.expEnter() a.clear() print("I've only got two weapons to spare, me \033[01;36m hammer \033[0m and me trusty \033[01;36m dagger \033[0m. Ye can take one of them with you. Which would you choose?") a.bag['items'].append("health potion") a.ask("\n \nWhich do you choose?\n") a.response() if a.answer.lower() == "hammer": a.bag['weapons'].append(str(a.answer)) print("%s has been added to your inventory." % (a.answer)) print(a.bag['weapons']) elif a.answer.lower() == "dagger": a.bag['weapons'].append(str(a.answer)) print("%s has been aded to your inventory." % (a.answer)) print(a.bag['weapons']) else: a.clear() print("Make a sensible choice, or you get nothin. %s wasn't one o' the things I offered" % (a.answer)) def main(): intro() if __name__ == '__main__': main()