예제 #1
0
def test_super_heal():
    gladiator_1 = core.Gladiator('Tom', 25, 40, 10, 10)
    assert gladiator_1.super_heal() == True
    assert gladiator_1.health == 45
    assert gladiator_1.rage == 0
    gladiator_1 = core.Gladiator('Tom', 25, 20, 10, 10)
    assert gladiator_1.super_heal() == False
예제 #2
0
def test_punch():
    gladiator_1 = core.Gladiator('Josh', 100, 20, 10, 10)
    gladiator_2 = core.Gladiator('Tom', 25, 20, 10, 10)
    assert gladiator_1.punch(gladiator_2) == None
    assert gladiator_1.rage == 0
    assert gladiator_1.health == 50
    assert gladiator_2.health == 5
예제 #3
0
def test_healer():
    gladiator_1 = core.Gladiator('Tom', 25, 45, 10, 10)
    gladiator_2 = core.Gladiator('Tom', 45, 45, 10, 10)
    assert gladiator_1.healer(gladiator_2) == None
    assert gladiator_1.health == 40
    assert gladiator_1.rage == 0
    assert gladiator_2.health == 30
예제 #4
0
def test_attack():
    gladiator_1 = core.Gladiator('Josh', 100, 0, 10, 10)
    gladiator_2 = core.Gladiator('Tom', 70, 0, 10, 10)
    assert gladiator_1.attack(gladiator_2) == None
    assert gladiator_1.rage == 15
    assert gladiator_2.health == 60
    gladiator_1 = core.Gladiator('Josh', 100, 100, 10, 10)
    gladiator_2 = core.Gladiator('Tom', 70, 100, 10, 10)
    assert gladiator_1.attack(gladiator_2) == None
    assert gladiator_1.rage == 0
    assert gladiator_2.health == 50
예제 #5
0
def main():
    print('\n\n\t\t\tWELCOME TO THE GLADIATOR BATTLE FOR PRESIDENCY GAME\n\n')
    low_damage_1, high_damage_1 = core.rand_damage(2, 15)
    gladiator_trump = core.Gladiator('Gladiator Trump', 100, 0, low_damage_1,
                                     high_damage_1)
    low_damage_2, high_damage_2 = core.rand_damage(5, 12)
    gladiator_clinton = core.Gladiator('Gladiator Clinton', 100, 0,
                                       low_damage_2, high_damage_2)
    print(repr(gladiator_trump), repr(gladiator_clinton), sep='\n')
    while True:
        gladiator_fight(gladiator_trump, gladiator_clinton)
        gladiator_fight(gladiator_clinton, gladiator_trump)
        print(gladiator_trump)
        print(gladiator_clinton)
예제 #6
0
def main():
    print('\n        ...Get Ready To Fight...\n')
    time.sleep(1.5)

    gladiator_1 = core.Gladiator(100, 0, 10, 20, 'Gladiator 1')

    gladiator_2 = core.Gladiator(100, 0, 10, 20, 'Gladiator 2')

    while True:
        print('\n***********************************************')
        print(gladiator_1)
        print(gladiator_2)
        print('_______________________________________________')
        fighter()
        time.sleep(.5)

        print('\n              Gladiator 1:')
        time.sleep(1)
        decision = get_move()

        if decision == 'attack':
            gladiator_1.attack(gladiator_2)
        elif decision == 'heal':
            gladiator_1.heal()
        # # elif decision == 'super sting':
        # #     gladiator_1.super_sting(other)
        if gladiator_2.is_dead():
            end_message('1')
            exit()
        ##########*******************#######PLAYER 2########*******************#########
        print('\n***********************************************')
        print(gladiator_1)
        print(gladiator_2)
        print('_______________________________________________')
        fighter()
        time.sleep(.5)

        print('\n             Gladiator 2:')
        time.sleep(1)
        decision = get_move()

        if decision == 'attack':
            gladiator_2.attack(gladiator_1)
        elif decision == 'heal':
            gladiator_2.heal()
        # elif decision == 'super sting':
        #     gladiator_2.super_sting(other)
        if gladiator_1.is_dead():
            end_message('2')
예제 #7
0
def test_Gladiator_init_is_implemented():
    gladiator = core.Gladiator('Josh', 1, 2, 3, 4)
    assert gladiator.name == 'Josh'
    assert gladiator.health == 1
    assert gladiator.rage == 2
    assert gladiator.damage_low == 3
    assert gladiator.damage_high == 4
예제 #8
0
def main():
    print("""              .-.
              | |____________________________________________________
 _ _ _ _ _ _ _| |                                                  .'`.
|_|_|_|_|_|_|_| | WELCOME TO GLADIATORS WAR!!--------------------.'****>
`.            | |_______________________________________________.'***.'
  `.        .'| |                                               `**'
    `-.___.'  `-' WHERE ONLY ONE GETS TO WALK AWAY ALIVE!!!    .'*`.
                                                               `._.' .
                                                               .   .'*`.
                                                             .'*`. `._.'\n
        Gladiator 1 has a low damage: 12 and high damage: 20\n
        Gladiator 2 has a low damage: 5 and high damage: 30\n\n
        CHOOSE WISELY!!\n
                            ,--.                       ,--.
                          _',|| )                     ( \\ |
            ,.,,.,-----""' "--v-.___                   `_\\.'--,..__
            |,"---.--''/       /,.__"")`-:|._________-"'     (--..__'/--.
                      /     ,."'    ""-'-"|'  _.,-"_.'-"\     \     ` '""
                   _ )____---------------(|--"_|--'      '__   \_
                _,' |  .''''""---.        '""'       ,---'''.   /".
            _,-'  ." \/,,..---/_ /                   | -|.._____|  \_
          ,-\,.'''            \ (                    |"")       "-,  \_
      _ .".--"                ( :                    | (           '. "\_
    ,- ,."                    ; !                    ; |             \,_ `.
___(_(."       ctr -------....L_">        _________.-/_J                '\_')
                                                     """
          "            ---------- "
          "")
    name = Gladiator_one()
    name_2 = Gladiator_two()
    gladiator_1 = core.Gladiator(name, 200, 0, 12, 20)
    gladiator_2 = core.Gladiator(name_2, 200, 0, 5, 30)
    intro_gladiator(gladiator_1, gladiator_2)
    while True:
        choice = gladiator_choice(name)
        gladiator_1_and_2_choice(choice, gladiator_1, gladiator_2, name,
                                 name_2)
        print(str(gladiator_1))
        print(str(gladiator_2))
        choice = gladiator_choice(name_2)
        gladiator_1_and_2_choice(choice, gladiator_2, gladiator_1, name_2,
                                 name)
        print(str(gladiator_1))
        print(str(gladiator_2))
def main():
    def slow_type(t):
        """
        Returns input() as slowtype,
        typing characters at an
        assigned pace.
        """

        typing_speed = 22

        for l in t:
            sys.stdout.write(l)
            sys.stdout.flush()
            time.sleep(typing_speed / 970.0)

        return input()

    print('Get..Ready...To...Fight...'.center(135))
    time.sleep(1)
    slow_type('\nPress "ENTER" To Begin!\n')

    gladiator_1 = slow_type('\nGladiator 1, Enter Your Name: ')
    gladiator_2 = slow_type('\nGladiator 2, Enter Your Name: ')

    jose = core.Gladiator(gladiator_1, 200, 30, 15, 30)
    liza = core.Gladiator(gladiator_2, 200, 30, 15, 30)

    print('☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠'.center(135))
    print(jose)
    time.sleep(.5)
    print('☠☠☠☠☠☠☠VS☠☠☠☠☠☠☠'.center(135))
    time.sleep(1)
    print(liza)
    print('☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠'.center(135))
    time.sleep(1)

    while True:
        if jose.is_dead():
            print('⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰'.center(135))
            print('{}! You Are Dead!'.center(135).format(gladiator_1))
            print('⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰'.center(135))
            exit()
        print('\n\n\n\n')
        print(jose)
        print('--------------------------------------------------------------'.
              center(135))
        print(liza)

        slap = core.Move('SLAP', randint(0, 25), 15, 20)
        kick = core.Move('KICK', randint(10, 30), 36, 23)
        bite = core.Move('BITE', randint(15, 40), 27, 16)
        slam = core.Move('SLAM', randint(30, 60), 43, 24)
        shoot = core.Move('SHOOT', randint(70, 90), 43, 29)
        conserve = core.Move('CONSERVE', 0, 0, 25)
        heal = core.Move('HEAL', 0, 5, 30)
        liza_sound = core.Move('1.LIZA "AAHHHHH??" SOUND', 100, 60, 45)
        jose_scream = core.Move('2.JOSE "AAEEEEE!!!" SCREAM', 80, 60, 45)

        print('\n\n')
        print('-> {}! <- -Make Your Move!-'.center(135).format(gladiator_1))
        print(
            '->👋 {}\n\n->☯ {}\n\n->😁 {}\n\n->💥 {}\n\n->🔫 {}\n\n->♻ {}\n\n->♥ {}\n\n->☢☣💀 {} 💀💀\n\n->♬♬ {}\n\n'
            .format(slap, kick, bite, slam, shoot, conserve, heal, liza_sound,
                    jose_scream))
        time.sleep(1)

        choice = slow_type('------->>>>> '.lower())

        if choice == 'slap':
            message = jose.attack(liza, slap)

        elif choice == 'kick':
            message = jose.attack(liza, kick)

        elif choice == 'bite':
            message = jose.attack(liza, bite)

        elif choice == 'slam':
            message == jose.attack(liza, slam)

        elif choice == 'shoot':
            message = jose.attack(liza, shoot)

        elif choice == 'heal':
            message = jose.heal(heal)

        elif choice == 'conserve':
            message = jose.conservative(conserve)

        else:
            print('Invalid Choice'.center(135))

        print(message)
        time.sleep(1)

        if liza.is_dead():
            status()
            print('⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰'.center(135))
            print('{}! You Are Dead!'.center(135).format(gladiator_2))
            print('⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰⚰'.center(135))
            exit()

        slap = core.Move('SLAP->->', randint(5, 25), 15, 20)
        kick = core.Move('KICK->->', randint(18, 39), 36, 23)
        bite = core.Move('BITE->->', randint(27, 51), 27, 16)
        slam = core.Move('SLAM->->', randint(45, 70), 43, 34)
        shoot = core.Move('SHOOT->->', randint(70, 90), 43, 40)
        conserve = core.Move('CONSERVE->->', 0, 0, 25)
        heal = core.Move('HEAL->->', 0, 5, 30)
        liza_sound = core.Move('\n1.LIZA "AAHHHHH??" SOUND', 100, 60, 45)
        jose_scream = core.Move('\n2.JOSE "AAEEEE!!!" SCREAM', 90, 60, 45)

        print('\n\n')
        print('-> {}! <- -Make Your Move!-'.center(135).format(gladiator_2))
        print(
            '->👋 {}\n\n->☯ {}\n\n->😁 {}\n\n->💥 {}\n\n->🔫 {}\n\n->♻ {}\n\n->♥ {}\n\n->☢☣💀 {} 💀💀\n\n->♬♬ {}\n\n'
            .format(slap, kick, bite, slam, shoot, conserve, heal, liza_sound,
                    jose_scream))
        time.sleep(1)

        choice = slow_type('------->>>>> '.lower())

        if choice == 'slap':
            message = liza.attack(jose, slap)

        elif choice == 'kick':
            message = liza.attack(jose, kick)

        elif choice == 'bite':
            message = liza.attack(jose, bite)

        elif choice == 'slam':
            message == liza.attack(jose, slam)

        elif choice == 'shoot':
            message = liza.attack(jose, shoot)

        elif choice == 'heal':
            message = liza.heal(heal)

        elif choice == 'conserve':
            message = liza.conservative(conserve)

            time.sleep(1)
        else:
            print('Invalid Choice!'.center(135))

        print(message)
        time.sleep(1)
예제 #10
0
def test_pass_rage():
    gladiator = core.Gladiator('Josh', 1, 2, 3, 4)
    assert gladiator.pass_rage() == None
    assert gladiator.rage == 32
예제 #11
0
def test_sword():
    gladiator_1 = core.Gladiator('Tom', 25, 50, 10, 10)
    gladiator_2 = core.Gladiator('Tom', 45, 45, 10, 10)
    assert gladiator_1.sword(gladiator_2) == None
    assert gladiator_1.rage == 0
    assert gladiator_2.health == 5
예제 #12
0
def test_lance():
    gladiator_1 = core.Gladiator('Tom', 25, 45, 10, 10)
    gladiator_2 = core.Gladiator('Tom', 45, 45, 10, 10)
    assert gladiator_1.lance(gladiator_2) == None
    assert gladiator_1.rage == 0
    assert gladiator_2.health == 10
예제 #13
0
def test_Gladiator_str_is_implemented():
    gladiator = core.Gladiator('Josh', 1, 2, 3, 4)
    assert str(
        gladiator
    ) == 'Josh: 1 HP ||| 2 Rage ||| Low damage: 3 ||| High damage: 4'
예제 #14
0
 def test_is_dead(self):
     self.piper = core.Gladiator('piper', 0, 1, 2, 3, 4)
     assert self.glad.is_dead() == False
     assert self.piper.is_dead() == True
예제 #15
0
 def test_attack(self):
     joe = core.Gladiator('jo', 100, 2, 45, 4, 5)
     assert self.glad.attack(joe) == joe
예제 #16
0
def test_heal():
    gladiator_1 = core.Gladiator('Josh', 85, 20, 10, 10)
    assert gladiator_1.heal() == None
    assert gladiator_1.rage == 10
    assert gladiator_1.health == 90
예제 #17
0
def test_is_dead():
    gladiator_1 = core.Gladiator('Josh', 85, 20, 10, 10)
    assert gladiator_1.is_dead() == False
    gladiator_1 = core.Gladiator('Josh', 0, 20, 10, 10)
    assert gladiator_1.is_dead() == True
예제 #18
0
 def test_heal(self):
     self.bill = core.Gladiator('bill', 1, 2, 0, 4, 5)
     assert self.glad.heal() == 11
     assert self.bill.heal() == None
예제 #19
0
def test_barbarian():
    gladiator_1 = core.Gladiator('Tom', 25, 45, 10, 10)
    gladiator_2 = core.Gladiator('Tom', 45, 45, 10, 10)
    assert gladiator_1.barbarian(gladiator_1) == None
    assert gladiator_1.rage == 0
    assert gladiator_2.health == 45
예제 #20
0
 def setup(self):
     self.glad = core.Gladiator('John', 1, 2, 45, 4, 5)
예제 #21
0
def test_bow_and_arrow():
    gladiator_1 = core.Gladiator('Tom', 25, 45, 10, 10)
    gladiator_2 = core.Gladiator('Tom', 45, 45, 10, 10)
    assert gladiator_1.bow_and_arrow(gladiator_2) == None
    assert gladiator_1.rage == 0
    assert gladiator_2.health == 15