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 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)