Пример #1
0
def create_player(mode, race, char_name):
    """ Create the player's character """
    if mode == 2:
        if race == 1:
            player = character.Goblin(char_name, app)
        elif race == 2:
            player = character.Orc(char_name, app)
        elif race == 3:
            player = character.Uruk(char_name, app)
        elif race == 4:
            player = character.Wizard(char_name, app)
        else:
            player = character.Haradrim(char_name, app)
    else:
        if race == 1:
            player = character.Elf(char_name, app)
        elif race == 2:
            player = character.Dwarf(char_name, app)
        elif race == 3:
            player = character.Human(char_name, app)
        elif race == 4:
            player = character.Hobbit(char_name, app)
        elif race == 5:
            player = character.Wizard(char_name, app)
        elif race == 6:
            player = character.Dunedain(char_name, app)
        elif race == 7:
            player = character.Crusader(char_name, app)
    return player  #Tells you your name & race e.g. "Gimli the Dwarf"
Пример #2
0
def create_player(mode, race, char_name):
    """ Create the player's character """
    # Evil
    if mode == 2:
        if race == 1:
            player = character.Goblin(char_name, 1, app)
        elif race == 2:
            player = character.Orc(char_name, 1, app)
        elif race == 3:
            player = character.Uruk(char_name, 1, app)
        else:
            player = character.Wizard(char_name, 1, app)
    # Good
    else:
        if race == 1:
            player = character.Human(char_name, 1, app)
        elif race == 2:
            player = character.Wizard(char_name, 1, app)
        elif race == 3:
            player = character.Warrior(char_name, 1, app)
        """elif race == 4:
            player = character.Hobbit(char_name, 1,  app)
        elif race == 6:
            player = character.Bishop(char_name, 1, app)
        else:
            player = character.Wizard(char_name, 1, app)"""
    return player
Пример #3
0
def create_player(mode, race, char_name):
    """ Create the player's character """
    # Aliens
    if mode == 2:
        if race == 1:
            player = character.Pyro(char_name, app)
        elif race == 2:
            player = character.Demo(char_name, app)
        elif race == 3:
            player = character.Helix(char_name, app)
        else:
            player = character.Wizard(char_name, app)
    # Humans
    else:
        if race == 1:
            player = character.Soldier(char_name, app)
        elif race == 2:
            player = character.Heavy(char_name, app)
        elif race == 3:
            player = character.Sniper(char_name, app)
        elif race == 4:
            player = character.Medic(char_name, app)
        else:
            player = character.Cyborg(char_name, app)
    return player
Пример #4
0
def create_enemies(mode, difficulty):
    """ Create the enemies """
    if mode == 2:  # Alien Mode - good enemies
        if difficulty == 'm':
            enemies = [
                character.Medic("Jensen", app),
                character.Medic("Marsh", app),
                character.Medic("Greenwood", app)
            ]
        elif difficulty == 'h':
            enemies = [
                character.Heavy("Bear", app),
                character.Sniper("Eagle", app),
                character.Soldier("Jock", app)
            ]
        elif difficulty == 'l':
            enemies = [
                character.Soldier("Jackson", app),
                character.Soldier("Maximus", app),
                character.Cyborg("Phoenix", app)
            ]
        else:
            enemies = [
                character.Medic("Fox", app),
                character.Medic("Cheetah", app)
            ]

    else:  # Human Mode - evil enemies
        if difficulty == 'm':
            enemies = [
                character.Demo("Demo 1", app),
                character.Pyro("Pyro", app),
                character.Demo("Demo 2", app)
            ]
        elif difficulty == 'h':
            enemies = [
                character.Demo("Demo 1", app),
                character.Demo("Demo 2", app),
                character.Helix("Helix", app)
            ]
        elif difficulty == 'l':
            enemies = [
                character.Demo("Demo", app),
                character.Helix("Helix", app),
                character.Wizard("Wizard", app)
            ]
        else:
            enemies = [
                character.Pyro("Pyro 1", app),
                character.Pyro("Pyro 2", app)
            ]

    return enemies
Пример #5
0
def file_load():
    """Load selected file"""
    # load the file from the folder and create the player.
    file = app.load_file()
    try:
        with open(file, 'r') as f:
            dict = {}
            for line in f.readlines():
                key, value = line.rstrip("\n").split(":")
                dict[key] = value
            global player
            global bag
            global battles
            global char_name
            battles = int(dict['Battles'])
            char_name = dict['Name'].rstrip()
            if dict['Job'] == " Bishop ":
                #print('True')
                player = character.Bishop(dict['Name'], int(dict['Level']),
                                          app)
                player.exp = int(dict['Exp'])
                app.write("You are now playing as " + player.name)
                return menu()
            elif dict['Job'] == " Wizard ":
                player = character.Wizard(dict['Name'], int(dict['Level']),
                                          app)
                app.write("You are now playing as " + player.name)
                player.exp = int(dict['Exp'])
                return menu()
            elif dict['Job'] == " Warrior ":
                player = character.Warrior(dict['Name'], int(dict['Level']),
                                           app)
                app.write("You are now playing as " + player.name)
                player.exp = int(dict['Exp'])
            elif dict['Job'] == " Paladin ":
                player = character.Paladin(dict['Name'].rstrip(),
                                           int(dict['Level']), app)
                app.write("You are now playing as " + player.name)
                player.exp = int(dict['Exp'])
            elif dict['Job'] == " Human ":
                player = character.Human(dict['Name'].rstrip(),
                                         int(dict['Level']), app)
                app.write("You are now playing as " + player.name)
                player.exp = int(dict['Exp'])
        return menu()

    except:
        app.write("File cannot be loaded, please try again")
Пример #6
0
def create_enemies(mode, difficulty):
    """ Create the enemies """
    roll = random.randint(0, 2)
    if mode == 2:
        if difficulty == 'm':
            enemies = [character.Hobbit("Peregrin", app), character.Hobbit("Meriadoc", app),
                       character.Human("Eowyn", app)]
        elif difficulty == 'h':
            enemies = [character.Dwarf("Gimli", app), character.Elf("Legolas", app), character.Human("Boromir", app)]
        elif difficulty == 'l':
            enemies = [character.Human("Faramir", app), character.Human("Aragorn", app),
                       character.Wizard("Gandalf", app)]
        elif difficulty == 'un':
            enemies = [character.Elf("Galadriel", app), character.Human("Treebeard", app), character.Uruk("Beorn", app)]
        elif difficulty == 'b':
            enemies = [character.Hobbit("Bilbo", app)]
        else:
            enemies = [character.Hobbit("Frodo", app), character.Hobbit("Sam", app)]

    else:
        if difficulty == 'm':
            enemies = [character.Goblin("Azog", app), character.Goblin("Gorkil", app), character.Orc("Sharku", app)]
        elif difficulty == 'h':
            enemies = [character.Orc("Shagrat", app), character.Orc("Gorbag", app), character.Uruk("Lurtz", app)]
        elif difficulty == 'l':
            enemies = [character.Orc("Grishnakh", app), character.Uruk("Lurtz", app), character.Wizard("Saruman", app)]
        elif difficulty == 'un':
            if roll == 0:
                enemies = [character.Nazgul("Witch-king of Angmar", app)]
            elif roll == 1:
                enemies = [character.Dragon("Smaug", app)]
            elif roll == 2:
                enemies = [character.Spider("Shelob", app)]
        elif difficulty == 'b':
            enemies = [character.Human("Grima", app)]
        else:
            enemies = [character.Goblin("Azog", app), character.Goblin("Gorkil", app)]

    return enemies
Пример #7
0
def create_enemies(mode, difficulty):
    """ Create the enemies """
    #Whaterver side player is choosing, they still end up facing the same types of monsters
    global map_level
    if mode == 2:  # Evil Mode - good enemies
        if difficulty == 'm':
            enemies = [
                character.Hobbit("Peregrin", 1, app),
                character.Hobbit("Meriadoc", 1, app),
                character.Human("Eowyn", 1, app)
            ]
        elif difficulty == 'h':
            enemies = [
                character.Dwarf("Gimli", 1, app),
                character.Elf("Legolas", 1, app),
                character.Human("Boromir", 1, app)
            ]
        elif difficulty == 'l':
            enemies = [
                character.Human("Sianas", 1, app),
                character.Human("Altern", 1, app),
                character.Wizard("Niapa", 1, app)
            ]
        elif difficulty == "b":
            return menu()
        else:
            enemies = [
                character.Hobbit("Frodo", 1, app),
                character.Hobbit("Sam", 1, app)
            ]

    else:  # Good Mode - evil enemies
        common, uncommon, rare, boss = read_map_level()
        if difficulty == 'm':
            enemies = [
                character.Mobs(common, map_level + random.randint(0, 5), app),
                character.Mobs(common, map_level + random.randint(0, 5), app),
                character.Mobs(uncommon, 1, app)
            ]
        elif difficulty == 'h':
            enemies = [
                character.Mobs(uncommon, map_level + random.randint(1, 6),
                               app),
                character.Mobs(uncommon,
                               map_level + map_level + random.randint(1, 6),
                               app),
                character.Mobs(uncommon,
                               map_level + map_level + random.randint(0, 4),
                               app)
            ]
        elif difficulty == 'l':
            enemies = [
                character.Mega(rare,
                               map_level + map_level + random.randint(0, 5),
                               app),
                character.Mega(rare, map_level + random.randint(0, 5), app),
                character.Mega(rare,
                               map_level + map_level + random.randint(0, 4),
                               app)
            ]
        elif difficulty == 's':
            enemies = [
                character.Dragon(boss, map_level + 1, app),
                character.Dragon(boss, map_level + 1, app)
            ]
        elif difficulty == 'b':
            return menu()
        else:
            enemies = [
                character.Mobs(common, map_level, app),
                character.Mobs(common, map_level, app)
            ]

    return enemies