Example #1
0
def check_the_dead(attacker, attacker_stats, defender, defender_stats):
    if core.is_dead(attacker_stats) == True:
        print('\n{} Is Victorious!!!'.format(defender.strip().capitalize()))
        exit()
    if core.is_dead(defender_stats) == True:
        print('\n{} Is Victorious!!!'.format(attacker.strip().capitalize()))
        exit()
Example #2
0
def battle(name_1, gladiator_1, name_2, gladiator_2):
    while True:
        if core.is_dead(gladiator_1) == True:
            print(name_2.upper(), 'Wins... Fatality!')
            break
            exit()
        if core.is_dead(gladiator_2) == True:
            print(name_1.upper(), 'Wins... Fatality!')
            break
            exit()
def gladiator(name_1, name_2):
    gladiator_one = core.new_gladiator(100, 0, 19, 33)
    gladiator_two = core.new_gladiator(100, 0, 20, 33)
    while True:
        print(name_1, gladiator_one['health'], 'hp', '!!!',
              gladiator_one['rage'], 'rage')
        print(name_2, gladiator_two['health'], 'hp', '!!!',
              gladiator_two['rage'], 'rage\n')
        while True:
            print('\nplayer one:\n {} your turn'.format(name_1))
            response = input(
                'Would you like to{}...???\n 1.[A]ttack, 2.[P]ass, 3.[Q]uit, 4.[H]eal'
            )
            if response == 'A':
                core.attack(gladiator_one, gladiator_two)
                print('gladiator_two health', gladiator_two['health'])
                break
            elif response == 'P':
                break
            elif response == 'Q':
                return
            elif response == 'H':
                core.heal(gladiator_one)
        if core.is_dead(gladiator_two):
            print('{}: YOU WIN!'.format(name_1))
            print('POOR TINK-TINK, YOU\'RE DEAD!!!!!')
            print('**~~~~GAME OVER~~~~**')
            break
        while True:
            print('\nplayer two:\n {} your turn'.format(name_2))
            response = input(
                'Would you like to...???\n 1.[A]ttack, 2.[P]ass, 3.[H]eal], 4.[Q]uit'
            )
            if response == 'A':
                core.attack(gladiator_two, gladiator_one)
                print('gladiator_one health', gladiator_one['health'])
                break
            elif response == 'P':
                break
            elif response == 'Q':
                return
            elif response == 'H':
                core.heal(gladiator_two)
        if core.is_dead(gladiator_one):
            print('{}: YOU WIN!'.format(name_2))
            print('POOR TINK-TINK, YOU\'RE DEAD!!!!!\n')
            print('**~~~~GAME OVER~~~~**\n')
            break
Example #4
0
def gladiator():
    glad = core.new_gladiator
    gladiator_1 = glad(100, 0, 10, 25)
    gladiator_2 = glad(100, 0, 10, 25)
    while True:
        while True:
            print('\nGladiator 1 your turn!\n')
            print('Gladiator 1', gladiator_1['health'], 'HP', '|||',
                  'Gladiator 1', gladiator_1['rage'], 'rage')
            response = input(
                '\nGladiator 1 what would you like to attack, heal, pass, or quit?\n'
            ).strip().lower()

            if response == 'a' or response == 'attack':
                core.attack(gladiator_1, gladiator_2)
                break
            elif response == 'h' or response == 'heal':
                core.heal(gladiator_1)
                break
            elif response == 'p' or response == 'pass':
                break
            elif response == 'q' or response == 'quit':
                return
        if core.is_dead(gladiator_2):
            print('Gladiator 1 Wins!')
            break
        while True:
            print('\nGladiator 2 your turn!\n')
            print('Gladiator 2', gladiator_2['health'], 'HP', '|||',
                  'Gladiator 2', gladiator_2['rage'], 'rage')
            response = input(
                '\nGladiator 2 what would you like to attack, heal, pass, or quit?\n'
            ).strip().lower()
            print('--------------------------------------------------')
            if response == 'a' or response == 'attack':
                core.attack(gladiator_2, gladiator_1)
                break
            elif response == 'h' or response == 'heal':
                core.heal(gladiator_2)
                break
            elif response == 'p' or response == 'pass':
                break
            elif response == 'q' or response == 'quit':
                return
        if core.is_dead(gladiator_1):
            print('Gladiator 2 Wins!')
            break
Example #5
0
def main():
    name_1 = input('Name your fighter Player 1. ')
    gladiator_1 = core.new_gladiator(name_1, 100, 10, 15, 25)
    print('Welcome to Mortal Kombat,', (name_1))

    name_2 = input('Name your fighter Player 2. ')
    gladiator_2 = core.new_gladiator(name_2, 100, 10, 15, 25)
    print('Welcome to Mortal Kombat,', (name_2))

    while not (core.is_dead(gladiator_1) or core.is_dead(gladiator_2)):
        show_gladiators(gladiator_1, gladiator_2)
        player_1_choice = get_choice()
        if player_1_choice == 'Attack':
            print(gladiator_1['name'], 'ATTACKS!')
            core.attack(gladiator_1, gladiator_2)
        elif player_1_choice == 'Pass':
            print(gladiator_1['name'], 'Passes!')
        elif player_1_choice == 'Heal':
            print(gladiator_1['name'], 'Heals!')
            core.heal(gladiator_1)
        elif player_1_choice == 'Quit':
            print(gladiator_2['name'], 'Wins... Quitality.')
            exit()

        show_gladiators(gladiator_2, gladiator_1)
        player_2_choice = get_choice()
        if player_2_choice == 'Attack':
            print(gladiator_2['name'], 'ATTACKS!')
            core.attack(gladiator_2, gladiator_1)
        elif player_2_choice == 'Pass':
            print(gladiator_2['name'], 'Passes!')
        elif player_2_choice == 'Heal':
            print(gladiator_2['name'], 'Heals!')
            core.heal(gladiator_2)
        elif player_2_choice == 'Quit':
            print(gladiator_1['name'], 'Wins... Quitality.')
            exit()
    battle(name_1, gladiator_1, name_2, gladiator_2)
Example #6
0
def gladiator_turn(attacker, defender):
    while True:
        core.defend_counter(attacker)
        if attacker['stunned_status']:
            if attacker['stunned_turns'] == 0:
                show_gladiators(attacker, defender)
                attacker['stunned_status'] = ''
                continue
            else:
                print("{} is stunned for {} turns)".format(
                    attacker['gladiator_name'], attacker['stunned_turns']))
                attacker['stunned_turns'] -= 1
                pass
        else:
            show_gladiators(attacker, defender)
            gladiator_move = gladiator_makes_move(attacker, defender)
            if gladiator_move == 'a':
                core.attack(attacker, defender)
            elif gladiator_move == 'supah kick':  #negative  health test
                defender['health'] -= 99
            elif gladiator_move == 'angery':  #crit hit test
                attacker['rage'] += 100
                continue
            elif gladiator_move == 'h':
                if attacker['rage'] < 10:
                    print("You try to heal, but you just aren't angry enough")
                elif attacker['health'] == 100:
                    print(
                        "You spend some time searching for wounds to self-treat, but no serious ones are found."
                    )
                else:
                    core.heal(attacker)
            elif gladiator_move == 'p':
                pass
            if core.is_dead(defender):
                print('{} has died. Funeral procession tommorrow... {} Wins!'.
                      format(defender['gladiator_name'],
                             attacker['gladiator_name']))
                break
        defender, attacker = attacker, defender
Example #7
0
def test_is_dead():
    choice = {'health': -1, 'rage': 30, 'damage_low': 3, 'damage_high': 12}
    assert core.is_dead(choice) == True
    choice = {'health': 10, 'rage': 30, 'damage_low': 3, 'damage_high': 12}
    assert core.is_dead(choice) == False
Example #8
0
def gladiator():
    print("----THE HAVOC STADIUM----")

    print("....setting up the game....")

    gladiator_1 = core.new_gladiator(100, 0, 10, 50)
    gladiator_2 = core.new_gladiator(100, 0, 5, 60)

    # print("*GLADIATOR 1*")
    while True:
        message = input(
            "**Before you start, choose your armor to battle with: \n *The Enclosed Helmet![1] \n *The Pavise Shield![2] \n *The Girdle of MIGHT![3] \n"
        ).strip()
        if message == 'The Enclosed Helmet' or message == '1':
            print("You have chosen the mighty ",
                  core.armor('Enclosed Heart'['nsame']))
            break

    print("*GLADIATOR 1*")
    while True:  # whole game play loop
        if core.is_dead(gladiator_1):
            print("Gladiator 1 has died, always in our hearts.")
            print("~~~GLADIATOR 2 WINS~~~")
            break

        while True:  # everything dealing with gladiator 1s turn
            print('Gladiator 1:', gladiator_1['health'], "HP", "||",
                  gladiator_1['rage'], "Rage")
            print("Gladiator 2:", gladiator_2['health'], "HP", "||",
                  gladiator_2['rage'], "Rage")

            response = input(
                "What would you lke to do? \n >> [a]ttack \n >> [p]ass \n >> [q]uit \n >> [h]eal \n  "
            ).strip().lower()
            if response == 'attack' or response == 'a':
                core.attack(gladiator_1, gladiator_2)
                print("You attacked Player 2, their health is now decreased!")
                print("Player 2's Health:", gladiator_2['health'])
                break
            elif response == 'pass' or response == 'p':
                print("You have passed to Gladiator 2!")
                break
            elif response == 'quit' or response == 'q':
                print("Hope you come to battle later!!")
                print("***QUITTING***")
                return
            elif response == 'heal' or response == 'h':
                core.heal(gladiator_1)
                print("You have healed your health!")
                print("Player 1's Current Health:", gladiator_1['health'])
            else:
                print("Invalid choice, pick a valid choice to fight!!")
        if core.is_dead(gladiator_2):
            print("~~~GLADIATOR 1 WINS~~~")
            print("Gladiator 2 has died, always in our hearts.")
            break

        print("-----------------------------------")
        print("*GLADIATOR 2*")
        print('Gladiator 1:', gladiator_1['health'], "HP", "||",
              gladiator_1['rage'], "Rage")
        print("Gladiator 2:", gladiator_2['health'], "HP", "||",
              gladiator_2['rage'], "Rage")

        while True:  # everything with the second glads turn
            response = input(
                "What would you lke to do? \n >> [a]ttack \n >> [p]ass \n >> [q]uit \n >> [h]eal \n  "
            ).strip().lower()
            if response == 'attack' or response == 'a':
                core.attack(gladiator_2, gladiator_1)
                print("You attacked Player 1, their health is now decreased!")
                print("Player 1's Health:", gladiator_1['health'])
                print("*GLADIATOR 1*")
                break
            elif response == 'pass' or response == 'p':
                print("You have passed to Gladiator 1!")
                print("*GLADIATOR 1*")
                break
            elif response == 'quit' or response == 'q':
                print("Hope you come to battle later!!")
                print("***QUITTING***")
                return
            elif response == 'heal' or response == 'h':
                core.heal(gladiator_1)
                print("You have healed your health!")
                print("Player 2's Current Health:", gladiator_2['health'])
                print("*GLADIATOR 1*")
            else:
                print("Invalid choice, pick a valid choice to fight!!")
Example #9
0
def main():
    Gladiator_start()
    gladiator_one = core.new_gladiator(100, 0, 12, 20)
    gladiator_two = core.new_gladiator(100, 0, 5, 30)
    while True:
        choice = gladiator_choice('1')
        if choice.lower() == '1':
            core.attack(gladiator_one, gladiator_two)
            if core.is_dead(gladiator_two):
                print('K.O. gladiator 1 wins')
                break
        elif choice.lower() == '3':
            print('Gladiator 1 looses')
            print('Gladiator 2 wins')
            exit()
        elif choice.lower() == '4':
            core.heal(gladiator_one)
        elif choice.lower() == '5':
            if core.supe_heal(gladiator_one):
                print('you have succesfully heal.\n')
            else:
                print(
                    'Sorry you do not enough rage. you need 30 or more to complete super heal.\n'
                )
        elif choice.lower() == '2':
            core.pass_rage(gladiator_one)
            print('gladiator 1 pass')
        elif choice.lower() == '6':
            core.punch(gladiator_one, gladiator_two)
            if core.is_dead(gladiator_two):
                print('K.O. gladiator 1 wins')
                break
        else:
            print('Invalid choice.')
        Gladiators1_details(gladiator_one)
        Gladiators2_details(gladiator_two)
        choice = gladiator_choice('2')
        if choice.lower() == '1':
            core.attack(gladiator_two, gladiator_one)
            if core.is_dead(gladiator_one):
                print('K.O. gladiator 2 wins')
                break
        elif choice.lower() == '3':
            print('Gladiator 2 looses')
            print('Gladiator 1 wins')
            exit()
        elif choice.lower() == '4':
            core.heal(gladiator_two)
        elif choice.lower() == '5':
            if core.supe_heal(gladiator_one):
                print('you have succesfully heal.\n')
            else:
                print(
                    'Sorry you do not enough rage. you need 30 or more to complete super heal.\n'
                )
        elif choice.lower() == '2':
            core.pass_rage(gladiator_two)
            print('gladiator 2 pass')
        elif choice.lower() == '6':
            core.punch(gladiator_two, gladiator_one)
            if core.is_dead(gladiator_one):
                print('K.O. gladiator 1 wins')
                break
        else:
            print('Invalid choice.\n')
        Gladiators1_details(gladiator_one)
        Gladiators2_details(gladiator_two)
Example #10
0
def test_is_dead():
    gladiator = {'Health': 0}
    core.is_dead(gladiator)
    assert gladiator['Health'] <= 0