Exemple #1
0
def town_mode_interpreter(keyEvent, previousModeIn=None):
    if previousModeIn is None:
        previousModeIn = town_mode
    global previousMode
    if keyEvent.key == K_ESCAPE:
        confirm_quit(previousMode)
    elif keyEvent.key == K_i:
        confirm_title_screen(previousMode)
    elif keyEvent.key == K_s:
        save(previousMode)
    elif keyEvent.key == K_l:
        load(previousMode)
    elif keyEvent.key == K_q:
        save_game('quick', previousMode)
    elif keyEvent.key == K_t:
        talk(previousMode)
    elif keyEvent.key == K_g:
        select_destination(previousMode)
    elif keyEvent.key == K_p:
        previousMode = previousModeIn
        universal.set_commands(['(#)Character', '<==Back'])
        universal.say_title('Characters:')
        #universal.say(''.join(['Name:', universal.tab("Name:"), 'Health:', universal.tab("Health:"), 'Mana:\n']))
        universal.say('\t'.join(['Name:', 'Health:', 'Mana:\n\t']), columnNum=3)
        universal.say(universal.state.party.display_party(), columnNum=3)
        universal.set_command_interpreter(select_character_interpreter)
Exemple #2
0
def can_enemies_spank():
    universal.say_title("Can Enemies Spank Your Characters In Battle?")
    universal.say(' '.join(["Now you have to decide whether or not enemies are allowed you to spank your characters in battle. If you select (Y)es, then enemies will try to spank you during",
        "combat. If you select no, then enemies will never try to spank you, however you can still try to spank them. Note that this does NOT affect story scenes. It only affects the generic",
        "spankings you can see in combat (so if you choose (N)o, but lose to a boss, the boss may still spank you after the battle. However the boss will not spank you during battle)."]))
    set_commands(['(Y)es', '(N)o', '<==Back'])
    set_command_interpreter(can_enemies_spank_interpreter)
Exemple #3
0
 def after_arrival(self):
     universal.say_title('Bedroom')
     if self.after_after_arrival is not None:
         self.after_after_arrival()
     universal.say(self.description)
     if self.boarding:
         rest_mode(self)
     else:
         town_mode()
Exemple #4
0
def request_difficulty():
    universal.say_title('Character Creation')
    universal.get_screen().blit(universal.get_background(), universal.get_world_view().topleft)
    universal.say('Before we get started, we need to pick a difficulty level:\n\n')
    universal.say('HAND: Enemies choose their actions purely at random.\n\n')
    universal.say('STRAP: Enemies choose their actions based on their own statistics, and the skills of their allies. They choose their target at random.\n\n')
    universal.say('CANE: Enemies choose their actions based on their statistics, the skills of their allies and previous rounds. They choose their target based on the effects of previous rounds.')
    universal.set_commands(['(H)and', '(S)trap', '(C)ane', '(Esc)Quit', '<==Back'])
    universal.set_command_interpreter(request_difficulty_interpreter)
Exemple #5
0
def select_char_quickspells(previousModeIn):
    universal.clear_screen()
    global previousMode
    previousMode = previousModeIn
    if len(universal.state.party) == 1:
        modify_quick_spells(universal.state.party[0])
    else:
        universal.say_title(format_line([chosenPerson.name + "'s", "Quick Spells"]))
        universal.say(universal.numbered_list(universal.state.party.members))
        set_commands(['(#) Select a character.', '<==Back'])
        set_command_interpreter(select_char_quickspells_interpreter)
Exemple #6
0
def request_musculature():
    universal.say_title('Select Musculature')
    musculature = '\n'.join([m + ':' for m in universal.numbered_list(person.MUSCULATURE)])
    musculatureDescr = [
            ' '.join(['', universal.state.player.name, '''has a soft, jiggly body.''']), 
            ' '.join(['', universal.state.player.name, '''has a firm, smooth body.''']), 
            ' '.join(['', universal.state.player.name, '''has a hard, muscled body.'''])
            ]
    musculatureDescr = '\n'.join(musculatureDescr)    
    universal.say(musculature + '\t' + musculatureDescr, justification=0, columnNum=3)
    set_command_interpreter(request_musculature_interpreter)
    set_commands(universal.SELECT_NUMBER_BACK_COMMAND)
Exemple #7
0
def select_underwear():
    """
    Asks the user which set of underwear the player character should wear.
    """
    global underwearList
    underwearList = [item for item in STARTING_INVENTORY if items.is_underwear(item)]
    if universal.state.player.lower_clothing() == items.emptyLowerArmor:
        underwearList.remove(items.emptyUnderwear)
    universal.say_title('Select Underwear')        
    universal.say('\n'.join(universal.numbered_list([underwear.name for underwear in underwearList])), justification=0)
    set_commands(SELECT_NUMBER_BACK_COMMAND)
    set_command_interpreter(select_underwear_interpreter)
Exemple #8
0
def select_weapon():
    """
    Asks the user to select a weapon, one of a dagger, sword, or spear.
    """
    global weaponList
    weaponList = [itemspotionwars.familyDagger, itemspotionwars.familySword,
            itemspotionwars.familySpear]
    universal.say_title('Request Weapon')
    universal.say('\n'.join(universal.numbered_list([weapon.name for weapon in
            weaponList])), justification=0)
    set_commands(SELECT_NUMBER_BACK_COMMAND)
    set_command_interpreter(select_weapon_interpreter)
Exemple #9
0
def town_mode(sayDescription=True):
    """
    Goes into town mode (i.e. displays the commands for town-mode, and says the description of the current location, if sayDescription is True. Otherwise, it doesn't
    say the description.
    """
    room = universal.state.location
    global previousMode
    previousMode = town_mode
    if sayDescription:
        universal.say_title(room.name)
    if sayDescription:
        universal.say_replace(room.get_description())
    universal.set_commands(['(P)arty', '(G)o', '(S)ave', '(Q)uick Save', '(T)alk', '(L)oad', '(Esc)Quit', 't(I)tle Screen'])
    universal.set_command_interpreter(town_mode_interpreter)
    music.play_music(room.bgMusic)
Exemple #10
0
def select_equipment():
    universal.say_title("Select Equipment to Enchant:")
    global equipmentList
    global partialNum
    equipmentList = []
    partialNum = ''
    for person in universal.state.party:
        equipmentList.extend([(person, equipment) for equipment in person.equipmentList
             if not items.is_empty_item(equipment) and 
            not items.is_pajamas(equipment)])
    personEquipmentStrings = [''.join([person.printedName, ": ", equipment.name]) for
            person, equipment in equipmentList]
    universal.say('\n'.join(universal.numbered_list(personEquipmentStrings)))
    universal.set_commands(["(#) Select Equipment: " + str(partialNum) + '_', "<==Back"])
    universal.set_command_interpreter(select_equipment_interpreter)
Exemple #11
0
def request_height():
    NUM_INCHES_IN_FOOT = 12
    NUM_METERS_IN_INCH = .0254
    def inches_to_meters(inches):
        return round(inches * NUM_METERS_IN_INCH, 2)
    universal.say_title('Select Height')
    height = universal.numbered_list([h + ':' for h in person.HEIGHTS])
    heightNums = [''.join(['''5' - 5'4" (''', str(inches_to_meters(60)), 'm - ', str(inches_to_meters(64)), '''m) ''']),
            ''.join(['''5'4" - 5'8" (''', str(inches_to_meters(64)), 'm - ', str(inches_to_meters(68)), '''m) ''']),
            ''.join(['''5'8" - 6'" (''', str(inches_to_meters(68)), 'm - ', str(inches_to_meters(72)), '''m) ''']),
            ''.join(['''over 6' (''', str(inches_to_meters(72)), '''m)'''])]
    heightNums = '\n'.join(heightNums)
    height = '\n'.join(height)
    universal.say(height + '\t' + heightNums, columnNum=4, justification=0)
    set_commands(universal.SELECT_NUMBER_BACK_COMMAND)
    set_command_interpreter(request_height_interpreter)
Exemple #12
0
def select_lower_clothing():
    """
    Asks the user for lower clothing to wear.
    """
    global pantsList
    if universal.state.player.lower_clothing() is \
            universal.state.player.shirt():
        select_underwear()
    else:
        universal.say_title('Select Lower Clothing')
        pantsList = [item for item in STARTING_INVENTORY if
                items.is_outer_lower_clothing(item) and
                     not items.is_full_clothing(item)]
        universal.say('\n'.join(universal.numbered_list([pants.name for pants
                in pantsList])), justification=0)
        set_commands(universal.SELECT_NUMBER_BACK_COMMAND)
        set_command_interpreter(select_lower_clothing_interpreter)
Exemple #13
0
def select_shirt():
    """
    Asks the player to select a shirt for the player character.
    """
    global shirtList, user_input
    user_input = ''
    universal.say_title('Select Shirt')
    shirtList = [item for item in STARTING_INVENTORY if
                 items.is_upper_clothing(item)]
    universal.say(
        '\n'.join(
            universal.numbered_list([shirt.name for shirt in shirtList])
        ),
        justification=0
    )
    if user_input:
        set_commands(universal.add_number_to_select_number_command(user_input))
    set_command_interpreter(select_shirt_interpreter)
Exemple #14
0
def load(returnMode=None):
    global returnTo, loadName, saveFiles
    if returnMode is not None:
        returnTo = returnMode
    else:
        returnTo = town_mode
    saveFiles = sorted([fileName for fileName in os.listdir('save') if fileName[0] != '.'])
    try:
        saveFiles.insert(0, saveFiles.pop(saveFiles.index('quick.sav')))
    except ValueError: 
        pass
    universal.clear_world_view()
    universal.say_title('Load')
    universal.say('\n'.join(universal.numbered_list([sf for sf in saveFiles if sf[0] != '.'])))
    if len(saveFiles) < 10:
        universal.set_commands(['(#) Select a file to load:', '<==Back'])
    else:
        universal.set_commands(['(#) Select a file to load:_', '<==Back'])
    universal.set_command_interpreter(load_interpreter)
Exemple #15
0
def select_gem(shopkeeperIn=None, doneShoppingLitany=None):
    global partialNum
    if sum(person.coins for person in universal.state.party) < 30 and (
            universal.state.enchantmentFreebies == 0):
        universal.say("You don't have enough money to enchant anything!")
        universal.acknowledge(done_shopping, ())
        return
    universal.say_title("Select Enhancement Gem")
    global gemList, litany, shopkeeper
    shopkeeper = shopkeeperIn
    litany = doneShoppingLitany
    gemList = []
    for person in universal.state.party:
        gemList.extend([(person, item) for item in person.get_inventory() if 
            hasattr(item, "enchantmentType")])
        gemStrings = [''.join([person.name, ": ", item.name]) for person, item in gemList]
    universal.say(universal.numbered_list(gemStrings))
    universal.set_commands(["(#) Select Gem: " + str(partialNum) + '_', "<==Back"])
    universal.set_command_interpreter(select_gem_interpreter)
    partialNum = ''
Exemple #16
0
def save(previousModeIn):
    global saveFiles, previousMode
    previousMode = previousModeIn
    try:
        saveFiles = sorted([file for file in os.listdir('save') if file[0] != '.'])
    except OSError:
        os.mkdir('save')
        saveFiles = sorted([file for file in os.listdir('save') if file[0] != '.'])
    universal.clear_world_view()
    universal.say_title('Save')
    try:
        saveFiles.insert(0, saveFiles.pop(saveFiles.index('quick.sav')))
    except ValueError:
        pass
    universal.say('\n'.join(universal.numbered_list(saveFiles)))
    if len(saveFiles) < 10:
        universal.set_commands(['Provide a save name:_', '(#) Select a save file.', '<==Back'])
    else:
        universal.set_commands([' '.join(['Provide a save name:_']), '(#) Select a save file:_', '<==Back'])
    universal.set_command_interpreter(save_interpreter)
def marias_home_after_arrival():
    universal.say_title("Maria's Home")
    maria = universal.state.get_character('Maria.person')
    mariasHome = universal.state.get_room("Maria's Home")
    if mariasHome.has(maria) and universal.state.player.currentEpisode == episode1.name:
        mariasHome.description = format_text([mariasHomeDesc, ['''Maria is hunched over the small firepit, making some stew. She glances up as''', name(), 
            '''enters.''']])
    if 'boarding_with_Maria' in keywords() and universal.state.player.currentEpisode == episode1.name:
        mariasHome.description = universal.format_text([['''Maria lives in a dinky little room with barely enough room for two people to lie down comfortably. The''',
    '''floor is packed dirt, and the old wooden walls sag, seeming on the verge of collapse at any moment. A small, stone-circled firepit sits in the''',
    '''center, just below a small hole in the ceiling. A small collection of wooden bowls, plates, and  skewers lie next to the pit. A pile of ragged''',
    '''blankets is crumpled up in the corner. A few additional blankets are spread out next to the firepit.''']])
        if 'Elise_shows_you_around' in keywords():
            mariasHome.description = universal.format_text([mariasHome.description, ['''There is a small note written in the dirt. It reads:''',
    '''"Went for a walk. Your blankets are spread out next to the pit. We'll look for a better place tomorrow. Maria"''']])
        mariasHome.description = format_text([mariasHome.description, [''' If''', name(), '''wishes,''', heshe(), 
            '''can Rest, and put an end to this seemingly neverending day.''']])
    if mariasHome.boarding:
        townmode.rest_mode(mariasHome)
    else:
        townmode.town_mode()
Exemple #18
0
def display_acknowledgments():
    universal.say_title('Acknowledgments')
    universal.get_screen().blit(universal.get_background(), universal.get_world_view().topleft)
    universal.say(format_text([['Code, Story, Concept: Andrew Russell'], 
        ['Editor: Emily the Eccentric Emu'],
        ['Support Writers: Emily the Eccentric Emu, Bonemouth the Boxfish, Ken the Kookaburra, Skyblaster the Sardine, Monkeytoster the Mongoose'],
        ['Beta Testers: Uninventive the Umbrellabird, Johny741 the Jackal, Bonemouth the Boxfish, Flash the Flamingo Emily the Eccentric Emu, Ken the Kookaburra, Skyblaster the Sardine, Monkeytoster the Mongoose'],
        ['Number Cruncher: Flash the Flamingo'],
        ['Images:'],
        ['  title screen image: Rak'],
        #['  Episode 1 titlecard: Lys'],
        #['Sound Effects: Filippo Vicarelli. Downloaded from his website: noiseforfun.com'],
        #['Dungeon step: Click Switch'],
        ['All music are free tracks posted by the authors on their websites. None of them are' +
            'involved in Pandemonium Cycle: The Potion Wars'],
        ['Music 1: Filippo Vicarelli: playonloop.com.'], 
        ['  Victory Theme: Waving Grass'],
        ['Music 2: Aaron Krogh https://soundcloud.com/aaron-anderson-11']
        ['  Title Theme: Megaboss Up Tempo'],
        ['  Episode 1 Titlecard: Pre Boss Battle Tension'],
        ["  Vengador's Theme: Heated Battle"],
        ['  Avaricum Theme: Wintry Town'],
        ['  Battle Theme: This Is Not A Drill'],
        ['  Tense Theme: Pre Boss Battle Tension'],
        ['  Defeated Theme: Heresy (also known as Splinter in the Mind)'],
        ["  Peter's Theme: Rose Petals"],
        ["  Edita's Theme: Lost"],
        ["  Maria's Theme : Never Forget"],
        ["  Carrie's Theme: My Friend"],
        ["  Catalin's Theme: Insidia"],
        ["  Roland's Theme: Desert Battle"],
        ["  Elise's Theme: Reflections in Tranquility"],
        ['Coded in Python using the Pygame engine: pygame.org'],
        ]
        ))
    acknowledge(title_screen, None)
Exemple #19
0
def load_game():
    universal.say_title('Load Game')
    universal.get_screen().blit(universal.get_background(), universal.get_world_view().topleft)
    townmode.load(title_screen)
Exemple #20
0
def confirm_enchantment():
    universal.say_title("Confirm:")
    universal.say(' '.join(["Enchant", chosenEquipment.name, "with", 
        chosenPersonGem[1].name + "?"]))
    set_commands(["(Enter) Enchant", "<==Back", "(Esc) Cancel"])
    set_command_interpreter(confirm_enchantment_interpreter)
Exemple #21
0
 def store_inventory(self):
     universal.say_title('Inventory')
     universal.say(universal.state.player.display_inventory())
     set_commands(['(#)View Item', '(Enter) View Stored Items', '<==Back'])
     set_command_interpreter(store_inventory_interpreter)
Exemple #22
0
 def store_items(self):
     universal.say_title('Stored Items')
     universal.say(', '.join(universal.numbered_list(self.items)))
     set_commands(['(#)View Item', '(Enter) View Inventory', '<==Back'])
     set_command_interpreter(store_items_interpreter)
Exemple #23
0
def style_character():
        universal.say_title('Whose hair should be styled?')
        universal.say(universal.numbered_list([member.printedName for member in universal.state.party.members]), justification=0)
        set_commands(universal.SELECT_NUMBER_BACK_COMMAND)
        set_command_interpreter(style_character_interpreter)
Exemple #24
0
def request_hair_style():
    universal.say_title('Select Hair Style')
    player = universal.state.player
    universal.say('\n'.join(numbered_list(get_hair_style())), justification=0)
    set_commands(SELECT_NUMBER_BACK_COMMAND)
    set_command_interpreter(request_hair_style_interpreter)
Exemple #25
0
def request_hair_length():
    universal.say_title('Select Hair Length')
    universal.say('\n'.join(numbered_list(person.HAIR_LENGTH)), justification=0)
    set_commands(universal.SELECT_NUMBER_BACK_COMMAND)
    set_command_interpreter(request_hair_length_interpreter)
Exemple #26
0
def request_body_type():
    universal.say_title('Select Body Type')
    bodyTypes = ["hunky" if universal.state.player.is_male() and bodyType == "voluptuous" else bodyType for bodyType in person.BODY_TYPES]
    universal.say('\n'.join(universal.numbered_list(bodyTypes)), justification=0)
    set_command_interpreter(request_body_type_interpreter)
    set_commands(universal.SELECT_NUMBER_BACK_COMMAND)