Exemplo n.º 1
0
    def archer(self):
        archer_player = Attributes()
        archer_armor = Armor()
        diceroll = DiceRoll()

        # *** Attributes ***
        Heroes.life = archer_player.constitution('Archer') + (self.level*diceroll.d6())
        Heroes.ranged_damage = archer_player.dexterity('Archer')
        Heroes.spell_damage = archer_player.intelligence('Archer')
        Heroes.melee_damage = archer_player.strength('Archer')

        # *** Armor Section ***
        Heroes.armor = archer_armor.natural_armor('Archer')
Exemplo n.º 2
0
    def archer(self):
        archer_player = Attributes()
        archer_armor = Armor()
        diceroll = DiceRoll()

        # *** Attributes ***
        Heroes.life = archer_player.constitution('Archer') + (self.level *
                                                              diceroll.d6())
        Heroes.ranged_damage = archer_player.dexterity('Archer')
        Heroes.spell_damage = archer_player.intelligence('Archer')
        Heroes.melee_damage = archer_player.strength('Archer')

        # *** Armor Section ***
        Heroes.armor = archer_armor.natural_armor('Archer')
Exemplo n.º 3
0
    def wizard(self):
        wizard_player = Attributes()
        wizard_armor = Armor()
        diceroll = DiceRoll()

        # *** Attributes ***
        Heroes.life = wizard_player.constitution('Wizard') + (self.level*diceroll.d4())
        Heroes.ranged_damage = wizard_player.dexterity('Wizard')
        Heroes.spell_damage = wizard_player.intelligence('Wizard')
        Heroes.melee_damage = wizard_player.strength('Wizard')

        # *** Armor Section ***
        Heroes.armor = (wizard_armor.natural_armor('Wizard') +
                        wizard_armor.chest_armor_defense('Robes of the Invoker'))
Exemplo n.º 4
0
    def wizard(self):
        wizard_player = Attributes()
        wizard_armor = Armor()
        diceroll = DiceRoll()

        # *** Attributes ***
        Heroes.life = wizard_player.constitution('Wizard') + (self.level *
                                                              diceroll.d4())
        Heroes.ranged_damage = wizard_player.dexterity('Wizard')
        Heroes.spell_damage = wizard_player.intelligence('Wizard')
        Heroes.melee_damage = wizard_player.strength('Wizard')

        # *** Armor Section ***
        Heroes.armor = (
            wizard_armor.natural_armor('Wizard') +
            wizard_armor.chest_armor_defense('Robes of the Invoker'))
Exemplo n.º 5
0
    def warrior(self):
        warrior_player = Attributes()
        warrior_armor = Armor()
        diceroll = DiceRoll()

        # *** Attributes ***
        Heroes.life = warrior_player.constitution('Warrior') + (self.level*diceroll.d10())
        Heroes.ranged_damage = warrior_player.dexterity('Warrior')
        Heroes.spell_damage = warrior_player.intelligence('Warrior')
        Heroes.melee_damage = warrior_player.strength('Warrior')

        # *** Armor Section***
        Heroes.armor = (warrior_armor.natural_armor('Warrior') +
                        warrior_armor.chest_armor_defense('Heart of Ares') +
                        warrior_armor.head_armor_defense("Drago's Visor of the Damned") +
                        warrior_armor.leg_armor_defense("Legguards of the Fallen King"))
Exemplo n.º 6
0
    def warrior(self):
        warrior_player = Attributes()
        warrior_armor = Armor()
        diceroll = DiceRoll()

        # *** Attributes ***
        Heroes.life = warrior_player.constitution('Warrior') + (self.level *
                                                                diceroll.d10())
        Heroes.ranged_damage = warrior_player.dexterity('Warrior')
        Heroes.spell_damage = warrior_player.intelligence('Warrior')
        Heroes.melee_damage = warrior_player.strength('Warrior')

        # *** Armor Section***
        Heroes.armor = (
            warrior_armor.natural_armor('Warrior') +
            warrior_armor.chest_armor_defense('Heart of Ares') +
            warrior_armor.head_armor_defense("Drago's Visor of the Damned") +
            warrior_armor.leg_armor_defense("Legguards of the Fallen King"))
 def assign_health(self, enemy_name, enemy_type):
     self.enemy_name = enemy_name
     self.enemy_type = enemy_type
     diceroll = DiceRoll()
     client = pymongo.MongoClient()
     db = client.enemies
     if enemy_type == 'Boss':
         enemies = db.boss.find()
         for e in enemies:
             if e['Enemy Name'] == enemy_name:
                 enemy_health = e['Enemy Health']
                 if '+' in enemy_health[:4]:
                     temp_hp = enemy_health[:3]
                     multiplier = temp_hp[0]
                     multiplier = int(multiplier)
                     dice = temp_hp[1:3]
                     print('Enemy Health Dice Roll= %s with a %sx Multiplier' % (dice, multiplier))
                     base_health = getattr(diceroll, dice)()
                     enemy_health = (base_health*multiplier) + int(temp_hp[-2:])
                     return enemy_health
                 else:
                     temp_hp = enemy_health[:4]
                     multiplier = temp_hp[0]
                     multiplier = int(multiplier)
                     dice = temp_hp[1:4]
                     print('Enemy Health Dice Roll= %s with a %sx Multiplier' % (dice, multiplier))
                     base_health = getattr(diceroll, dice)()
                     enemy_health = (base_health*multiplier) + int(temp_hp[-2:])
                     return enemy_health
     elif enemy_type == 'Minion':
         enemies = db.minion.find()
         for e in enemies:
             if e['Enemy Name'] == enemy_name:
                 enemy_health = e['Enemy Health']
                 if '+' in enemy_health[:4]:
                     temp_hp = enemy_health[:3]
                     multiplier = temp_hp[0]
                     multiplier = int(multiplier)
                     dice = temp_hp[1:3]
                     print('Enemy Health Dice Roll= %s with a %sx Multiplier' % (dice, multiplier))
                     base_health = getattr(diceroll, dice)()
                     enemy_health = (base_health*multiplier) + int(enemy_health[-2:])
                     return enemy_health
                 else:
                     temp_hp = enemy_health[:4]
                     multiplier = temp_hp[0]
                     multiplier = int(multiplier)
                     dice = temp_hp[1:4]
                     print('Enemy Health Dice Roll= %s with a %sx Multiplier' % (dice, multiplier))
                     base_health = getattr(diceroll, dice)()
                     print(int(enemy_health[:-2]))
                     enemy_health = (base_health*multiplier) + int(enemy_health[-2:])
                     return enemy_health
 def assign_attack_damage(self, enemy_name, enemy_type):
     self.enemy_name = enemy_name
     self.enemy_type = enemy_type
     diceroll = DiceRoll()
     client = pymongo.MongoClient()
     db = client.enemies
     if enemy_type == 'Boss':
         enemies = db.boss.find()
         for e in enemies:
             if e['Enemy Name'] == enemy_name:
                 attack_damage = e['Enemy Attack Damage']
                 if '+' in attack_damage[:4]:
                     temp_ad = attack_damage[:3]
                     multiplier = temp_ad[0]
                     multiplier = int(multiplier)
                     dice = temp_ad[1:3]
                     print('Enemy Attack Damage Dice Roll= %s with a %sx Multiplier' % (dice, multiplier))
                     base_attack = getattr(diceroll, dice)()
                     attack_damage = (base_attack*multiplier) + int(attack_damage[-1:])
                     return attack_damage
                 else:
                     temp_ad = attack_damage[:4]
                     multiplier = temp_ad[0]
                     multiplier = int(multiplier)
                     dice = temp_ad[1:4]
                     print('Enemy Attack Damage Dice Roll= %s with a %sx Multiplier' % (dice, multiplier))
                     base_attack = getattr(diceroll, dice)()
                     attack_damage = (base_attack*multiplier) + int(attack_damage[-1:])
                     return attack_damage
     elif enemy_type == 'Minion':
         enemies = db.minion.find()
         for e in enemies:
             if e['Enemy Name'] == enemy_name:
                 attack_damage = e['Enemy Attack Damage']
                 if '+' in attack_damage[:4]:
                     temp_ad = attack_damage[:3]
                     multiplier = temp_ad[0]
                     multiplier = int(multiplier)
                     dice = temp_ad[1:3]
                     print('Enemy Attack Damage Dice Roll= %s with a %sx Multiplier' % (dice, multiplier))
                     base_attack = getattr(diceroll, dice)()
                     attack_damage = (base_attack*multiplier) + int(attack_damage[-1:])
                     return attack_damage
                 else:
                     temp_ad = attack_damage[:4]
                     multiplier = temp_ad[0]
                     multiplier = int(multiplier)
                     dice = temp_ad[1:4]
                     print('Enemy Attack Damage Dice Roll= %s with a %sx Multiplier' % (dice, multiplier))
                     base_attack = getattr(diceroll, dice)()
                     attack_damage = (base_attack*multiplier) + int(attack_damage[-1:])
                     return attack_damage
Exemplo n.º 9
0
class Game:

    level = 0
    hero_select = 0
    diceroll = DiceRoll()

    print('Welcome Adventurer to the Land of Blank \n'
          'To begin your adventure you must first select your starting level and class! \n'
          'The higher level you choose the more difficult the game will be \n')
    while level == ((level < 1) and (level > 16)):
        level = input('Select the Level(Between 1 and 15) to begin your adventure: ')
        if (level < '1') and (level > '16'):
            print('\nIncorrect input, please try again\n')
        else:
            level = int(level)              # Type cast to int to pass to Heroes()
            break
    champion = Heroes(level)
    print('There are 3 classes available \n'
          'Choose wisely \n'
          '1. Wizard \n'
          '2. Warrior \n'
          '3. Archer \n')
    while hero_select != (1 | 2 | 3):
        hero_select = input('Select a Hero Class by entering a number: ')
        if hero_select is '1':
            champion.wizard()
            break
        elif hero_select is '2':
            champion.warrior()
            break
        elif hero_select is '3':
            champion.archer()
            break
        else:
            print('\nIncorrect input, please try again\n')

# -----------------------------------------------------------------------------------------------------------

    print("\nThe Following is a list of your Hero's stats")
    print(str(Heroes.life) + ' Hit Points')
    print(str(Heroes.ranged_damage) + ' Damage versus Ranged')
    print(str(Heroes.spell_damage) + ' Damage with spells')
    print(str(Heroes.melee_damage) + ' Damage with a melee weapon')
    print(str(Heroes.armor) + ' Armor')
    print('---------------------------------')
    print("\nLet the Adventure Begin\n")

# -----------------------------------------------------------------------------------------------------------

    # Insert Condition statement whether our Adventurer runs into an enemy

# -----------------------------------------------------------------------------------------------------------

    # Create Random Enemy Minion Based on Location and Level
    map_Location = 'Black Forest'
    randEnemy1 = RandomEnemy()
    randEnemy1_Name = randEnemy1.generator(level, 'Minion')
    print("As you walk through the %s you encounter a %s" % (map_Location, randEnemy1_Name))
    randEnemy1_attack_damage = randEnemy1.assign_attack_damage(randEnemy1_Name, 'Minion')
    randEnemy1_health = randEnemy1.assign_health(randEnemy1_Name, 'Minion')

# -----------------------------------------------------------------------------------------------------------

    Minion1 = Enemy(randEnemy1_Name, randEnemy1_attack_damage, randEnemy1_health)
    Minion1.enemy_stats()
    print("\nWhat would you like to do\n"
          "Attack With Melee weapon\n"
          "Attack With Ranged weapon\n"
          "Attack with Spell\n")
    Minion1.enemy_damaged_health(Heroes.melee_damage)
    print("\nGnoll swings at you and hits you for " + str(Minion1.attack_damage))
    Heroes.life -= Minion1.attack_damage
    print("You have " + str(Heroes.life) + " Hit points left")