Example #1
0
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)
Example #2
0
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)
Example #3
0
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)