def A2_text(history): print print print if overall.if_empty(A2_inventory) == True: print delay("You enter an empty room") print elif overall.if_empty(A2_inventory) == False: print delay("You enter a room. On the floor lies a: ") print for item in A2_inventory: print delay(item) print if 'visited' in history: pass else: print delay("TUTORIAL: To check your health type 'health'. Don't let your health get too low!") print print delay("TUTORIAL: To view what you have in your inventory, type 'inventory'") print print delay("At the NORTH, SOUTH, and WEST sides of the room are doors.") print print player_input = raw_input("What do you want to do?: ") overall.action(player_input) new_command = overall.command A2(new_command, overall.subject, player_input)
def B3_text(history): print print print if 'visited' not in history: overall.final_enemy.is_alive = True overall.final_enemy.is_asleep = False else: pass delay("You enter a large stone cavern lit by a ring of torches.") print print delay("There are doors at the EAST and NORTH ends of the room.") print print if overall.final_enemy.is_alive == True: if overall.final_enemy.is_asleep == True: delay( "A great large slumbering hound sleeps curled up in the middle of the room." ) print elif overall.final_enemy.is_asleep == False: delay( "A great large hound the size of a small house stands in the center of the room. It catches sight of you as you enter and snarls." ) print print delay("The ENEMY moves to attack!") print else: pass if overall.if_empty(B3_inventory) == False: print delay("On the floor lies a: ") for item in B3_inventory: print delay(item) print print else: delay("On the floor lies the body of a slain ENEMY") print if overall.if_empty(B3_inventory) == False: print delay("On the floor also lies a: ") for item in B3_inventory: print delay(item) print print player_input = raw_input("What do you want to do?: ") overall.action(player_input) new_command = overall.command if overall.final_enemy.is_alive == True and overall.final_enemy.is_asleep == False: B3_combat(new_command, overall.subject, player_input) else: B3(new_command, overall.subject, player_input)
def A3_text(history): print print print if 'visited' not in history: overall.enemy1.is_alive = True else: pass delay('You enter a large circular room with a soaring ceiling, supported by a ring of pillars and lit by flaming braziers. The floor is a a sand pit, littered with human bones and skulls.') print print delay("There are doors at the WEST and SOUTH sides of the room") print print if overall.enemy1.is_alive == True: delay("At the center of the room stands a masked ENEMY, armed with a viciously long knife") print if overall.if_empty(A3_inventory) == False: print delay("On the floor lies a: ") for item in A3_inventory: print delay(item) print print delay("The ENEMY moves to attack!") print print else: delay("On the floor lies the body of a slain ENEMY") print if overall.if_empty(A3_inventory) == False: print delay("On the floor also lies a: ") for item in A3_inventory: print delay(item) print print player_input = raw_input("What do you want to do?: ") overall.action(player_input) new_command = overall.command if overall.enemy1.is_alive == True: A3_combat(new_command, overall.subject, player_input) else: A3(new_command, overall.subject, player_input)
def B3(command, subject, player_input): global success if command == 1: history.append('visited') B4.B4_text(B4.history) success = True elif command == 2 or command == 4: print delay("A wall blocks your way.") print success = False elif command == 3: history.append('visited') A3.A3_text(A3.history) elif command == 5: if subject.lower() in B3_inventory: overall.main_character.inventory[subject] = B3_inventory[subject] del B3_inventory[subject] print delay("%s has been added to inventory" % (subject)) elif subject.lower( ) in overall.final_enemy.inventory and overall.final_enemy.is_alive == False: overall.main_character.inventory[ subject] = overall.final_enemy.inventory[subject] del overall.final_enemy.inventory[subject] print delay("%s added to inventory" % (subject)) elif subject.lower( ) in overall.final_enemy.inventory and overall.final_enemy.is_alive == True and overall.final_enemy.is_asleep == True: print delay("The ENEMY is still, you can not take items from it.") elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' % (subject)) else: print delay("Can not pick up %s" % (subject)) print sucess = False elif command == 6: print if subject.lower() in overall.main_character.inventory: B3_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' % (subject)) else: delay('%s not in inventory' % (subject)) print success = False elif command == 7: if subject.lower() == 'enemy' and overall.if_empty( overall.final_enemy.inventory ) == False and overall.final_enemy.is_alive == False: print delay("The body of the enemy contains a: ") print for item in overall.final_enemy.inventory: print delay(item) print print elif subject.lower() == 'enemy' and overall.if_empty( overall.final_enemy.inventory ) == True and overall.final_enemy.is_alive == False: print delay("This body carries nothing on it.") print elif subject.lower( ) == 'enemy' and overall.final_enemy.is_alive == True and overall.final_enemy.is_asleep == True: print delay("This ENEMY is still alive. You can not search it.") print else: print delay("Cannot search %s" % (subject)) print print success = False elif command == 8: print if subject.lower( ) in overall.main_character.inventory and overall.main_character.inventory[ subject.lower( )].form == 'weapon' and overall.final_enemy.is_asleep == True: print delay("As you attack the ENEMY stirs from its slumber.") print overall.final_enemy.is_asleep = False B3_combat(command, subject, 0) elif subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject.lower()].use() if overall.main_character.inventory[ subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' % (subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' % (subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: B3_reit(nothing)
def B3_combat(command, subject, player_input): if command == 1 or command == 2 or command == 3 or command == 4: print delay("You try to flee, but the ENEMY hound catches you first") print elif command == 5: if subject.lower() in A3_inventory: print delay( "You move to pick up the %s, but the ENEMY hound blocks your way." ) print else: print delay("There is no %s to pick up.") print elif command == 6: print if subject.lower( ) in overall.main_character.inventory and subject.lower( ) == 'dried meat': delay("dried meat has been removed from inventory") print print delay( "The hound stops and sniffs the air. It questioningly walks over to the dried meat and in one bite snaps it up and swallows. It looks at you and licks your face, then turns and walks away to lie down." ) print print delay("The ENEMY is now asleep") print overall.final_enemy.is_asleep = True del overall.main_character.inventory[subject.lower()] elif subject.lower() in overall.main_character.inventory: B3_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' % (subject)) else: delay('%s not in inventory' % (subject)) print elif command == 7: print delay("Nothing here to search.") print elif command == 8: print if subject.lower( ) in overall.main_character.inventory and overall.main_character.inventory[ subject.lower()].form == 'weapon': delay( "You attack the ENEMY hound with your %s. You deal %s damage." % (subject.lower(), overall.main_character.inventory[subject.lower()].value)) print overall.final_enemy.health -= overall.main_character.inventory[ subject.lower()].value overall.final_enemy.enemy_death() elif subject.lower( ) in overall.main_character.inventory and overall.main_character.inventory[ subject.lower()].form == 'instrument': overall.main_character.inventory[subject].use() print delay( "The hound stops and tilts its head. It then lets out a humongous yawn, lays down, rests its head on its paws, and closes its eyes." ) print print delay("The ENEMY is now asleep.") print print overall.final_enemy.is_asleep = True elif subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[ subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' % (subject)) print elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' % (subject)) print elif command == 11: print overall.main_character.death() else: pass if overall.final_enemy.is_alive == True and overall.final_enemy.is_asleep == False: print delay( "The ENEMY hound runs over and attacks, taking you in its mouth and violently shaking you, then throwing you to the opposite side of the room." ) print overall.final_enemy.enemy_attack() B3_combat_reit(nothing) else: player_input = raw_input("What do you want to do?: ") overall.action(player_input) new_command = overall.command B3(new_command, overall.subject, player_input)
def A2(command, subject, player_input): global success if command == 1: if 'unlocked' in history: print history.append('visited') A3.A3_text(A3.history) success = True else: print delay('This door is locked') print success = False elif command == 2: history.append('visited') B2.B2_text(B2.history) elif command == 3: print delay("A wall blocks your way") print success = False elif command == 4: history.append("visited") A1.A1_text(A1.history) elif command == 5: if subject.lower() in A2_inventory: overall.main_character.inventory[subject] = A2_inventory[subject] del A2_inventory[subject] print delay('%s has been added to inventory' %(subject)) elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' %(subject)) else: print delay("Can not pick up %s" %(subject)) print success = False elif command == 6: print if subject.lower() in overall.main_character.inventory: A2_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' %(subject)) else: delay('%s not in inventory' %(subject)) print success = False elif command == 7: print delay('Nothing here to search') print success = False elif command == 8: print if subject.lower() == 'iron key' and subject.lower() in overall.main_character.inventory: history.append('unlocked') delay("IRON KEY unlocks the NORTH door") print elif subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' %(subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' %(subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: A2_reit(nothing)
def B2(command, subject, player_input): global success if command == 1 or command == 2 or command == 4: print delay("A wall blocks your way.") print success = False elif command == 3: history.append('visited') A2.A2_text(A2.history) elif command == 5: if subject.lower() in B2_inventory: overall.main_character.inventory[subject] = B2_inventory[subject] del B2_inventory[subject] print delay('%s has been added to inventory' % (subject)) elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' % (subject)) else: print delay("Can not pick up %s" % (subject)) print success = False elif command == 6: print if subject.lower() in overall.main_character.inventory: B2_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' % (subject)) else: delay('%s not in inventory' % (subject)) print success = False elif command == 7: if subject.lower() == 'chest' and overall.if_empty( B2_inventory) == False: print delay("The chest contains a: ") print for item in B2_inventory: print delay(item) print if overall.if_empty(B2_inventory) == True: print delay("This chest is empty") print print if 'searched' not in history: delay( "TUTORIAL: To use an item, type 'use' and the name of the item you want to use." ) print print delay( "TUTORIAL: To view the description of an object in your inventory type 'analyze' and the name of the object." ) print print history.append('searched') elif subject.lower() == 'chest' and overall.if_empty( B2_inventory) == True: print delay("This chest is empty") print else: print delay("Can not search %s" % (subject)) print success = False elif command == 8: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[ subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' % (subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' % (subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: B2_reit(nothing)
def B4(command, subject, player_input): global success if command == 1: if 'unlocked' in history: print history.append('visited') delay("You open the white door, and the first thing you notice is the brilliant, blinding golden light... ") print print delay("To be continued...") print print delay("Victory! Game Over") print print sys.exit() success = True elif 'unlocked' not in history and overall.master.is_alive == False: print delay("This door is locked") print success = False elif 'unlocked' not in history and overall.master.is_alive == True: print delay('You walk over to the white door and try to open it.') print print time.sleep(1.5) delay('The white door is locked') print print time.sleep(1.5) delay('By the time you realize your mistake it is too late') print print time.sleep(1.5) delay('The old man leaps from behind his desk, knife in hand and stabs you in the back.') print print time.sleep(1.5) delay('As you fall to the floor and bleed out, he stands over you with a wicked grin on his face and says "Did you really think you could leave this place alive? Ha. You are not but one of many who will meet their end in this place."') print print time.sleep(1.5) delay('You Died: Game Over') sys.exit() success = False elif command == 2 or command == 3: print delay("A wall blocks your way") print success = False elif command == 4: history.append('visited') B3.B3_text(B3.history) elif command == 5: if subject.lower() in B4_inventory: if overall.master.is_alive == True: print delay('As you try to pick up the %s the old man says "Ahem, what do you think you are doing? That is mine you can not take it."' %(subject)) print else: overall.main_character.inventory[subject] = B4_inventory[subject] del B4_inventory[subject] print delay('%s has been added to inventory' %(subject)) print elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' %(subejct)) print else: print delay("Can not pick up %s" %(subject)) print success = False elif command == 6: print if subject.lower() in overall.main_character.inventory: B4_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' %(subject)) else: delay('%s not in inventory' %(subject)) print success = False elif command == 7: if overall.master.is_alive == False: if subject.lower() == 'desk' and overall.if_empty(B4_inventory) == False: print delay('This desk contains a: ') print for item in B4_inventory: print delay(item) print elif subject.lower() == 'desk' and overall.if_empty(B4_inventory) == True: print delay('This desk is empty.') print else: print delay('Can not search %s' %(subject)) print else: print delay('You try to lean in to search the desk, but the man stops you and says "Ahem, just what do you think you are doing? Stop that."') print success = False elif command == 8: print if subject.lower() == 'white key' and subject.lower() in overall.main_character.inventory: history.append('unlocked') delay('WHITE KEY unlocks NORTH door') print elif subject.lower() in overall.main_character.inventory and overall.main_character.inventory[subject.lower()].form == 'weapon' and overall.master.is_alive == True: delay("You raise your %s and the old man's eyes widen in fear. He yells 'WAIT, NO, HOW DID YOU KNOW?' just before your %s comes down and chops off his head. The knife concealed in his hand under the desk clatters to the ground." %(subject, subject)) print overall.master.is_alive = False elif subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' %(subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' %(subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: B4_reit(nothing)
def A3(command, subject, player_input): global success if command == 1 or command == 3: print delay("A wall blocks your way.") print success = False elif command == 2: history.append('visited') B3.B3_text(B3.history) success = True elif command == 4: history.append('visited') A2.A2_text(A2.history) elif command == 5: if subject.lower() in A3_inventory: overall.main_character.inventory[subject] = A3_inventory[subject] del A3_inventory[subject] print delay("%s has been added to inventory" %(subject)) elif subject.lower() in overall.enemy1.inventory: overall.main_character.inventory[subject] = overall.enemy1.inventory[subject] del overall.enemy1.inventory[subject] print delay('%s has been added to inventory' %(subject)) elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' %(subject)) else: print delay("Can not pick up %s" %(subject)) print success = False elif command == 6: print if subject.lower() in overall.main_character.inventory: A3_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' %(subject)) else: delay('%s not in inventory' %(subject)) print success = False elif command == 7: if subject.lower() == 'enemy' and overall.if_empty(overall.enemy1.inventory) == False: print delay("The body of the enemy contains a: ") print for item in overall.enemy1.inventory: print delay(item) print print elif subject.lower() == 'enemy' and overall.if_empty(overall.enemy1.inventory) == True: print delay("This body carries nothing on it") print else: print delay("Cannot search %s" %(subject)) print print success = False elif command == 8: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject.lower()].use() if overall.main_character.inventory[subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' %(subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' %(subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: A3_reit(nothing)
def A3_combat(command, subject, player_input): if command == 1 or command == 2 or command == 3 or command == 4: print delay("You try to flee, but the ENEMY warrior catches you first") print elif command == 5: if subject.lower() in A3_inventory: print delay("You move to pick up the %s, but the ENEMY warrior blocks your way.") print else: print delay("There is no %s to pick up.") print elif command == 6: print if subject.lower() in overall.main_character.inventory: A3_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' %(subject)) else: delay('%s not in inventory' %(subject)) print elif command == 7: print delay("Nothing here to search.") print elif command == 8: print if subject.lower() in overall.main_character.inventory and overall.main_character.inventory[subject.lower()].form == 'weapon': delay("You attack the ENEMY warrior with your %s. You deal %s damage." %(subject.lower(), overall.main_character.inventory[subject.lower()].value)) print overall.enemy1.health -= overall.main_character.inventory[subject.lower()].value overall.enemy1.enemy_death() elif subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' %(subject)) print elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' %(subject)) print elif command == 11: print overall.main_character.death() else: pass if overall.enemy1.is_alive == True: print delay("The ENEMY warrior attacks with a lacerating cut from its knife.") print overall.enemy1.enemy_attack() A3_combat_reit(nothing) else: player_input = raw_input("What do you want to do?: ") overall.action(player_input) new_command = overall.command A3(new_command, overall.subject, player_input)
def B4(command, subject, player_input): global success if command == 1: if 'unlocked' in history: print history.append('visited') delay( "You open the white door, and the first thing you notice is the brilliant, blinding golden light... " ) print print delay("To be continued...") print print delay("Victory! Game Over") print print sys.exit() success = True elif 'unlocked' not in history and overall.master.is_alive == False: print delay("This door is locked") print success = False elif 'unlocked' not in history and overall.master.is_alive == True: print delay('You walk over to the white door and try to open it.') print print time.sleep(1.5) delay('The white door is locked') print print time.sleep(1.5) delay('By the time you realize your mistake it is too late') print print time.sleep(1.5) delay( 'The old man leaps from behind his desk, knife in hand and stabs you in the back.' ) print print time.sleep(1.5) delay( 'As you fall to the floor and bleed out, he stands over you with a wicked grin on his face and says "Did you really think you could leave this place alive? Ha. You are not but one of many who will meet their end in this place."' ) print print time.sleep(1.5) delay('You Died: Game Over') sys.exit() success = False elif command == 2 or command == 3: print delay("A wall blocks your way") print success = False elif command == 4: history.append('visited') B3.B3_text(B3.history) elif command == 5: if subject.lower() in B4_inventory: if overall.master.is_alive == True: print delay( 'As you try to pick up the %s the old man says "Ahem, what do you think you are doing? That is mine you can not take it."' % (subject)) print else: overall.main_character.inventory[subject] = B4_inventory[ subject] del B4_inventory[subject] print delay('%s has been added to inventory' % (subject)) print elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' % (subejct)) print else: print delay("Can not pick up %s" % (subject)) print success = False elif command == 6: print if subject.lower() in overall.main_character.inventory: B4_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' % (subject)) else: delay('%s not in inventory' % (subject)) print success = False elif command == 7: if overall.master.is_alive == False: if subject.lower() == 'desk' and overall.if_empty( B4_inventory) == False: print delay('This desk contains a: ') print for item in B4_inventory: print delay(item) print elif subject.lower() == 'desk' and overall.if_empty( B4_inventory) == True: print delay('This desk is empty.') print else: print delay('Can not search %s' % (subject)) print else: print delay( 'You try to lean in to search the desk, but the man stops you and says "Ahem, just what do you think you are doing? Stop that."' ) print success = False elif command == 8: print if subject.lower() == 'white key' and subject.lower( ) in overall.main_character.inventory: history.append('unlocked') delay('WHITE KEY unlocks NORTH door') print elif subject.lower( ) in overall.main_character.inventory and overall.main_character.inventory[ subject.lower( )].form == 'weapon' and overall.master.is_alive == True: delay( "You raise your %s and the old man's eyes widen in fear. He yells 'WAIT, NO, HOW DID YOU KNOW?' just before your %s comes down and chops off his head. The knife concealed in his hand under the desk clatters to the ground." % (subject, subject)) print overall.master.is_alive = False elif subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[ subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' % (subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' % (subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: B4_reit(nothing)
def A1(command, subject, player_input): global success if command == 1: history.append("visited") A2.A2_text(A2.history) success = True elif command == 2 or command == 3: print delay("A wall blocks your way") print success = False elif command == 4: print delay("This door is closed and sealed.") print success = False elif command == 5: if subject.lower() in A1_inventory: overall.main_character.inventory[subject] = A1_inventory[subject] del A1_inventory[subject] print delay("%s has been added to inventory" % (subject)) elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' % (subject)) else: print delay("Can not pick up %s" % (subject)) print success = False elif command == 6: print if subject.lower() in overall.main_character.inventory: A1_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' % (subject)) else: delay('%s not in inventory' % (subject)) print success = False elif command == 7: print delay("Nothing here to search") print success = False elif command == 8: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[ subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay("No %s in inventory" % (subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay("%s not in inventory" % (subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: A1_reit(nothing)
def A1_text(history): print print print global player_input delay("You enter a room lit by a single torch.") print if 'visited' not in history: print delay("The door behind you closes and seals.") print else: pass if 'note' not in A1_inventory: if overall.if_empty(A1_inventory) == True: print delay( "The room is empty except for a barren alter standing at its center." ) print elif overall.if_empty(A1_inventory) == False: print delay( "The room is empty except for an alter standing at its center. Upon the alter sits a: " ) print for item in A1_inventory: print delay(item) print if 'note' in A1_inventory: print delay( "The room is empty except for an alter standing at its center. Upon the alter is a NOTE." ) print print if overall.if_empty(A1_inventory) == False and overall.count > 1: delay("On the alter there also sits a: ") for item in A1_inventory: print delay(item) print print delay("The NOTE reads: ") print note.describe() else: pass if 'visited' in history: pass else: print delay( "TUTORIAL: To pick up an item, type 'pick up' and the name of the item you want to pick up. For example, if you wanted to pick up an apple, you would type 'Pick up apple'" ) print print delay( "TUTORIAL: If you want to get rid of an item, type 'drop' and the name of the item you want to get rid of. Remember, if you drop an item you can always come back and pick it up!" ) print print delay("There is a door on the NORTH side of the room") print print if 'visited' in history: delay( "There is a closed and sealed door at the SOUTH side of the room") print print player_input = raw_input("What do you want to do?: ") overall.action(player_input) new_command = overall.command A1(new_command, overall.subject, player_input)
def B2(command, subject, player_input): global success if command == 1 or command == 2 or command == 4: print delay("A wall blocks your way.") print success = False elif command == 3: history.append('visited') A2.A2_text(A2.history) elif command == 5: if subject.lower() in B2_inventory: overall.main_character.inventory[subject] = B2_inventory[subject] del B2_inventory[subject] print delay('%s has been added to inventory' %(subject)) elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' %(subject)) else: print delay("Can not pick up %s" %(subject)) print success = False elif command == 6: print if subject.lower() in overall.main_character.inventory: B2_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory' %(subject)) else: delay('%s not in inventory' %(subject)) print success = False elif command == 7: if subject.lower() == 'chest' and overall.if_empty(B2_inventory) == False: print delay("The chest contains a: ") print for item in B2_inventory: print delay(item) print if overall.if_empty(B2_inventory) == True: print delay("This chest is empty") print print if 'searched' not in history: delay("TUTORIAL: To use an item, type 'use' and the name of the item you want to use.") print print delay("TUTORIAL: To view the description of an object in your inventory type 'analyze' and the name of the object.") print print history.append('searched') elif subject.lower() == 'chest' and overall.if_empty(B2_inventory) == True: print delay("This chest is empty") print else: print delay("Can not search %s" %(subject)) print success = False elif command == 8: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay('No %s in inventory' %(subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay('%s not in inventory' %(subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: B2_reit(nothing)
def A1(command, subject, player_input): global success if command == 1: history.append("visited") A2.A2_text(A2.history) success = True elif command == 2 or command == 3: print delay("A wall blocks your way") print success = False elif command == 4: print delay("This door is closed and sealed.") print success = False elif command == 5: if subject.lower() in A1_inventory: overall.main_character.inventory[subject] = A1_inventory[subject] del A1_inventory[subject] print delay("%s has been added to inventory" %(subject)) elif subject.lower() in overall.main_character.inventory: print delay('%s already in inventory' %(subject)) else: print delay("Can not pick up %s"%(subject)) print success = False elif command == 6: print if subject.lower() in overall.main_character.inventory: A1_inventory[subject] = overall.main_character.inventory[subject] del overall.main_character.inventory[subject] delay('%s has been removed from inventory'%(subject)) else: delay('%s not in inventory'%(subject)) print success = False elif command == 7: print delay("Nothing here to search") print success = False elif command == 8: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].use() if overall.main_character.inventory[subject.lower()].form == 'food': del overall.main_character.inventory[subject.lower()] else: delay("No %s in inventory" %(subject)) print success = False elif command == 9: for item in overall.main_character.inventory: print delay(item) print if overall.if_empty(overall.main_character.inventory) == True: print delay("You have nothing in your inventory!") print success = False elif command == 10: print if subject.lower() in overall.main_character.inventory: overall.main_character.inventory[subject].describe() else: delay("%s not in inventory" %(subject)) print success = False elif command == 11: print overall.main_character.death() success = False else: success = False if success == False: A1_reit(nothing)
def A1_text(history): print print print global player_input delay("You enter a room lit by a single torch.") print if 'visited' not in history: print delay("The door behind you closes and seals.") print else: pass if 'note' not in A1_inventory: if overall.if_empty(A1_inventory) == True: print delay("The room is empty except for a barren alter standing at its center.") print elif overall.if_empty(A1_inventory) == False: print delay("The room is empty except for an alter standing at its center. Upon the alter sits a: ") print for item in A1_inventory: print delay(item) print if 'note' in A1_inventory: print delay("The room is empty except for an alter standing at its center. Upon the alter is a NOTE.") print print if overall.if_empty(A1_inventory) == False and overall.count > 1: delay("On the alter there also sits a: ") for item in A1_inventory: print delay(item) print print delay("The NOTE reads: ") print note.describe() else: pass if 'visited' in history: pass else: print delay("TUTORIAL: To pick up an item, type 'pick up' and the name of the item you want to pick up. For example, if you wanted to pick up an apple, you would type 'Pick up apple'") print print delay("TUTORIAL: If you want to get rid of an item, type 'drop' and the name of the item you want to get rid of. Remember, if you drop an item you can always come back and pick it up!") print print delay("There is a door on the NORTH side of the room") print print if 'visited' in history: delay("There is a closed and sealed door at the SOUTH side of the room") print print player_input = raw_input("What do you want to do?: ") overall.action(player_input) new_command = overall.command A1(new_command, overall.subject, player_input)