Exemplo n.º 1
0
    def slash_ataque(self) -> bool:
        conf = self.configuracao
        if not self.partida.tem_inimigos_pra_slash_ataque():
            print(
                f'\nVocê não pode usar o SLASH com menos de {conf.slash_inimigos_min} inimígos'
            )
            return False
        if not self.partida.tem_sp_para_slash_ataque():
            slow_print(
                f'\nVocê não possui SP suficiente (Slash = {conf.sp_custo_slash} SP)',
                atraso=conf.atraso_padrao)
            return False

        self.partida.slash()
        opcao = valida_int([1, 2], 'Selecionar inimigos (1) ou AUTO (2):\n')
        lista_inimigo_s = []
        if opcao == 1:
            lista_limite = self.partida.posicao_de_inimigos()
            for cont_slash in range(0, conf.slash_inimigos_min):
                inimigo_s = valida_int(
                    lista_limite,
                    f"Selecione o {cont_slash + 1}º inimigo da lista acima: \n",
                    INIMIGO_FORA_DA_LISTA)
                lista_limite.remove(inimigo_s)
                lista_inimigo_s.append(inimigo_s)
        elif opcao == 2:
            lista_inimigo_s = sample(self.partida.posicao_de_inimigos(), 5)

        caixa(' SLASH ATTACK !!!')
        sleep(conf.atraso_metade)
        for posicao in lista_inimigo_s:
            dano_player = self.partida.dano_slash_ataque()
            self.danifica_inimigo(posicao, dano_player)
        slow_print('\n', atraso=conf.atraso_metade)
        return True
Exemplo n.º 2
0
 def verifica_bonus_de_vida(self) -> None:
     if self.partida.n_rodadas_b == 3:
         if self.partida.n_rodadas % 10 == 0:
             if self.partida.jogador.sp < 25:
                 self.partida.jogador.bonus_sp(72)
                 slow_print('\nHERÓI GANHOU 75 SP !!!',
                            atraso=self.configuracao.atraso_medio)
Exemplo n.º 3
0
 def imprime_inimigos(self) -> None:
     conf = self.configuracao
     slow_print('\n-----.::| LISTA DE INIMIGOS |::.-----\n',
                conf.atraso_metade)
     t_atraso = self.atraso(self.partida.n_inimigos)
     for inimigo in self.partida.inimigos:
         slow_print(
             f' - inimigo {inimigo.numero:3d} vida: {barra(inimigo.vida, dez=None)}',
             t_atraso)
     print(f'\nNº de inimigos = {self.partida.n_inimigos}')
Exemplo n.º 4
0
 def super_cura(self) -> bool:
     conf = self.configuracao
     if not self.partida.pode_super_cura() < conf.sp_custo_supercura:
         slow_print(
             f'\nVocê não possui SP suficiente (SUPER CURAR = {conf.sp_custo_supercura} SP)',
             atraso=conf.atraso_padrao)
         return False
     pontos_super_cura = self.partida.super_cura()
     print(f'Você recuperou {pontos_super_cura} pontos de vida!\n')
     print(f'  VIDA: {self.partida.jogador.vida}')
     slow_print(f'  SP: {self.partida.jogador.sp}\n',
                atraso=conf.atraso_medio)
     return True
Exemplo n.º 5
0
    def turno_do_inimigo(self) -> bool:
        conf = self.configuracao
        soma_dano_inimigo = 0
        slow_print('\n----- .::| TURNO DO INIMIGO |::. -----\n',
                   atraso=conf.atraso_metade)
        for inimigo in self.partida.inimigos:
            dano = self.partida.dano_inimigo()
            if dano > 0:
                slow_print(f'Inimigo {inimigo.numero} causou {dano} de dano!',
                           self.atraso(self.partida.n_inimigos))
                soma_dano_inimigo += dano
            else:
                slow_print(f'Inimigo {inimigo.numero} ERROU o ataque!',
                           self.atraso(self.partida.n_inimigos))

            if self.partida.n_rodadas_b != 3 and self.partida.jogador.vida < 0:
                self.berserker()
            if self.partida.n_rodadas_b == 2:
                break

        if self.partida.n_rodadas_b != 2:
            slow_print(f'\nDANO TOTAL = {soma_dano_inimigo}',
                       atraso=conf.atraso_padrao)
            print('=' * 39)
        return self.fim_de_jogo()
Exemplo n.º 6
0
 def pierce_ataque(self) -> bool:
     conf = self.configuracao
     if not self.partida.pode_pierce_ataque():
         slow_print(
             '\n Você não possui SP suficiente (PIERCE = {conf.sp_pierce} SP)',
             conf.atraso_padrao)
         return False
     self.partida.pierce()
     lista_limite = self.partida.posicao_de_inimigos()
     posicao = valida_int(lista_limite,
                          'Selecione um inimigo da lista acima:\n',
                          INIMIGO_FORA_DA_LISTA)
     dano_player = self.partida.dano_pierce()
     caixa(f'PIERCE ATTACK !!!')
     self.danifica_inimigo(posicao, dano_player)
     return True
Exemplo n.º 7
0
    def danifica_inimigo(self, posicao: int, dano: int):
        conf = self.configuracao
        escolhido = self.partida.pega_inimigo_por_posicao(posicao)

        pv_inimigo_antes = escolhido.vida
        self.partida.danifica_inimigo(escolhido, dano)

        slow_print(f'\n Atacando o inimigo {posicao}',
                   atraso=conf.atraso_metade)
        slow_print(
            f" Você causou {dano} de dano ao inimigo {posicao}! "
            f"({pv_inimigo_antes} - {dano} = {escolhido.vida})",
            atraso=conf.atraso_metade)
        if escolhido.morto():
            caixa(f'  Você matou o inimigo {posicao}!', borda='x')
            sleep(conf.atraso_metade)
Exemplo n.º 8
0
    def loop(cls, configuracao) -> None:
        jogando = True
        while jogando:
            jogo = Jogo(configuracao)
            jogo.titulo()
            while True:
                if jogo.partida.n_rodadas_b == 2:
                    jogo.partida.n_rodadas_b = 3
                jogo.imprime_inimigos()
                jogo.imprime_status_do_heroi()
                if jogo.turno_do_heroi():
                    break
                if jogo.turno_do_inimigo():
                    break
                jogo.partida.fim_rodada()

            jogando = jogo.jogar_novamente()
        slow_print('\n--- FIM ---', atraso=jogo.configuracao.atraso_padrao)
def gate_keeper(player):
    from ai_talk import keeper
    if player['mission8'] == True:
        keeper("You are worthy to travel, where do you wish to go?")
        print("[1] Thorg World")
        print("[2] Healing Place")
        print("[3] Blacksmith's shop")
        i = input()
        if i == '1':
            player['location'] = 'Thorg World'
        elif i == '2':
            player['location'] = 'Healing Place'
        elif i == '3':
            player['location'] = "Blacksmiths shop"
        else:
            keeper("I'm afraid I do not know that location...")
    else:
        keeper("Who dares to travel to this hidden place?")
        keeper("I am the keeper, I guard this gate so that none may pass")
        keeper("Leave or be destroyed!")
        print("[1] Leave | [2] Challenge the keeper of the Gate to battle")
        t = input()
        if t == '1':
            keeper('You have made a wise decision')
        else:
            keeper("You dare challenge me to battle?")
            keeper(
                "I can singly handedly wipe out armies! You dare to battle me!"
            )
            print("Are you sure you want to battle him?")
            print("[1] Yes | [2] No")
            z = input()
            if z == '1':
                keeper(
                    "Arise my brothers, fellow guardians of the path, let us go into battle!"
                )
                util.slow_print(
                    "Fellow Keepers: We have arisen brother, whom will we destroy?"
                )
                multi_battle.keepers_of_the_gate(player)
            else:
                print("You escape...")
            input()
Exemplo n.º 10
0
 def turno_do_heroi(self) -> bool:
     conf = self.configuracao
     slow_print('-----.::| TURNO DO HERÓI |::.-----\n',
                atraso=conf.atraso_metade)
     self.menu()
     return self.fim_de_jogo()
Exemplo n.º 11
0
 def fim_morte(self) -> None:
     conf = self.configuracao
     print('\nVIDA = 0\n')
     slow_print(' .::| GAME OVER |::.\n', atraso=conf.atraso_padrao)
Exemplo n.º 12
0
 def fim_vitoria(self) -> None:
     conf = self.configuracao
     sleep(conf.atraso_metade)
     print('\n Nº Inimigos = 0\n')
     slow_print('.::| PARABÉNS, VOCÊ MATOU TODOS OS INIMIGOS |::.',
                atraso=conf.atraso_pequeno)
Exemplo n.º 13
0
    def berserker(self):
        conf = self.configuracao
        dano_b_total = [0] * conf.berzerker_max_rodadas
        cont_morte = [0] * conf.berzerker_max_rodadas
        self.pre_berserker()

        slow_print('\n-----::..::| MODO BERSERKER ATIVADO |::..::-----\n',
                   atraso=conf.atraso_padrao)
        while self.partida.n_rodadas_b < 2 and self.partida.n_inimigos > 0:
            slow_print(
                f'\n=====.::| BERSERKER RODADA {self.partida.n_rodadas_b + 1} |::.=====\n',
                atraso=conf.atraso_medio)

            slow_print('.::| ATAQUES BERSERKER |::.',
                       atraso=conf.atraso_pequeno)
            for n_ataques in range(self.partida.n_inimigos):
                escolhido, vida_antes, dano_b = self.partida.berzerker_ataque()
                dano_b_total[self.partida.n_rodadas_b] += dano_b
                slow_print(
                    f"\n Você causou {dano_b} de dano ao inimigo {escolhido.numero} ! "
                    f"({vida_antes} - {dano_b} = {escolhido.vida})",
                    self.atraso(self.partida.n_inimigos))
                if escolhido.vida <= 0:
                    caixa(f'   Você matou o inimigo {escolhido.numero}!')
                    sleep(self.atraso(self.partida.n_inimigos))
                    cont_morte[self.partida.n_rodadas_b] += 1
                if self.partida.n_inimigos == 0:
                    slow_print('\n Nº Inimigos = 0\n',
                               atraso=conf.atraso_padrao)
                    slow_print(
                        ' .::| PARABÉNS, VOCÊ MATOU TODOS OS INIMIGOS |::.',
                        atraso=conf.atraso_pequeno)
                    break

            slow_print(
                f'\n\n.::| FIM DA RODADA {self.partida.n_rodadas_b + 1} |::.',
                atraso=conf.atraso_padrao)
            self.partida.n_rodadas_b += 1
        vida_drenada, _ = self.partida.berzerker_recupera_vida()
        self.berserker_stats(cont_morte, dano_b_total, vida_drenada)
Exemplo n.º 14
0
 def pre_berserker(self):
     conf = self.configuracao
     slow_print(f'\n VIDA DO HERÓI = {self.partida.jogador.vida}',
                atraso=conf.atraso_padrao)
     slow_print(' ...', atraso=conf.atraso_pequeno)
     slow_print(' ..', atraso=conf.atraso_pequeno)
     slow_print(' .', atraso=conf.atraso_pequeno)
     slow_print('\n GOLPE FATAL !!!', atraso=conf.atraso_padrao)
     slow_print('\n NOSSO HERÓI SUCUMBE DIANTE DA HORDA INIMIGA ...',
                atraso=5)
     slow_print(' ...', atraso=conf.atraso_pequeno)
     slow_print(' ..', atraso=conf.atraso_pequeno)
     slow_print(' .', atraso=conf.atraso_pequeno)
     slow_print('\n É O FIM.', end='', atraso=conf.atraso_padrao * 2)
     slow_print('.', end='', atraso=conf.atraso_pequeno)
     slow_print('.', end='', atraso=conf.atraso_pequeno)
     slow_print(' MAS ESPERE !!!!!\n', atraso=conf.atraso_pequeno)
     slow_print(' O QUE ESTÁ ACONTECENDO...?!?!?\n',
                atraso=conf.atraso_padrao)
     slow_print(' NÚVENS NEGRAS SURGEM E O CÉU COMEÇA A ESCURECER...\n',
                atraso=conf.atraso_padrao)
     slow_print(' TUDO ESTÁ TREMENDO,\n', atraso=conf.atraso_padrao)
     slow_print(' RAIOS ECLODEM DA TERRA E RASGAM O CÉU...\n',
                atraso=conf.atraso_padrao)
     slow_print(
         ' TROVÕES IRROMPEM TODA A REGIÃO, ESTREMECENDO O ÍMPITO DO INIMIGO.\n',
         atraso=conf.atraso_padrao)
     slow_print(
         ' DO MADA, UMA ENORME EXPLOSÃO ARREMESSA OS INIMIGOS CENTENAS DE METROS...\n',
         atraso=conf.atraso_padrao)
     slow_print(' DO SEU EPICENTRO, ESTÁ NOSSO HERÓI...\n',
                atraso=conf.atraso_padrao)
     slow_print(' MAS AGORA ELE ESTÁ DIFERENTE...\n',
                atraso=conf.atraso_padrao)
     slow_print(' AGORA ELE ESTÁ SEDENTO POR SANGUE.\n',
                atraso=conf.atraso_padrao)
     slow_print(' NOSSO HERÓI SE TORNOU...UM BERSERKER !!!\n',
                atraso=conf.atraso_padrao)
     slow_print(' TEMIDO POR SUA IRA, O BESERKER SE TORNOU UMA LENDA...\n',
                atraso=conf.atraso_padrao)
     slow_print(
         ' SEU CORPO POSSUI UMA AURA NEGRA E VERVELHA, SEUS OLHOS SÃO BRANCOS, E DELES SAEM\n'
         ' RAIOS QUE ESTRAÇALHAM AS ROCHAS AO SEU REDOR; \n',
         atraso=conf.atraso_padrao)
     slow_print(
         ' FLUTUAMDO RENTE AO SOLO, NOSSO HERÓI ENCARA OS INIMIGOS...\n',
         atraso=conf.atraso_padrao)
     slow_print(
         ' E EM FRAÇÃO DE SEGUNDOS OS ALCANÇA, DESFERINDO ATAQUES DE GRANDE PODER.\n',
         atraso=conf.atraso_padrao)
     pausa(' PRESSIONE ENTER PARA CONTINUAR...\n')
     sleep(conf.atraso_pequeno)
def yeckity_toe(player):
	util.clear()
	enemy = create_t(20, 40, 'Yeckity Toe', 'yeckity toe', 40, 5, 10, 15, random.choice(['Yeckity Toe Slizzer', 'Yeckity Toe Throwing Spear']), 'yeckity toe', 'Shield')
	extra_damage = 0
	extra_health = 0
	if player['specialty1'] == 'Thorgslayer' and enemy.type == 'Thorg':
		extra_damage += 5 * player['specialty1_level']
	elif player['specialty1'] == 'Swordsmen' and player['main_weapon'] in ('Sword', 'Fire Blade', 'Ice Pick', 'Long Sword' 'Dragon Slayer', 'Lightening Blade', 'Yeckity Toe Slizzer'):
		extra_damage += 2 * player['specialty1_level']
	elif player['specialty1'] == 'Archer' and player['main_weapon'] in ('Bow', 'Kraveb Crossbow', 'Street Crossbow', 'Lightening Bow', 'Thorg War Bow'):
		extra_damage += 2 * player['specialty1_level']
	elif player['specialty1'] == 'Spearmen' and player['main_weapon'] in ('Spear', 'Kraveb Heavy Spear', 'Rat Spear', 'Thorg War Spear', 'Yeckity Toe Throwing Spear'):
		extra_damage += 2 * player['specialty1_level']
	elif player['specialty1'] == 'Thug' and player['main_weapon'] == 'Heavy Wooden Clobberstick':
		extra_damage += 5 * player['specialty1_level']
	elif player['specialty1'] == 'Healer':
		extra_health += 2 * player['specialty1_level']
	elif player['specialty1'] == 'Specialist' and player['main_weapon'] in ('Fists', 'Sharp Stick'):
		extra_damage += 5 * player['specialty1_level']
	### YALL GOT SPAMMED
	if player['specialty2'] == 'Thorgslayer' and enemy.type == 'Thorg':
		extra_damage += 5 * player['specialty2_level']
	elif player['specialty2'] == 'Swordsmen' and player['main_weapon'] in ('Sword', 'Fire Blade', 'Ice Pick', 'Long Sword' 'Dragon Slayer', 'Lightening Blade', 'Yeckity Toe Slizzer'):
		extra_damage += 2 * player['specialty2_level']
	elif player['specialty2'] == 'Archer' and player['main_weapon'] in ('Bow', 'Kraveb Crossbow', 'Street Crossbow', 'Lightening Bow', 'Thorg War Bow'):
		extra_damage += 2 * player['specialty2_level']
	elif player['specialty2'] == 'Spearmen' and player['main_weapon'] in ('Spear', 'Kraveb Heavy Spear', 'Rat Spear', 'Thorg War Spear', 'Yeckity Toe Throwing Spear'):
		extra_damage += 2 * player['specialty2_level']
	elif player['specialty2'] == 'Thug' and player['main_weapon'] == 'Heavy Wooden Clobberstick':
		extra_damage += 5 * player['specialty2_level']
	elif player['specialty2'] == 'Healer':
		extra_health += 2 * player['specialty2_level']
	elif player['specialty2'] == 'Specialist' and player['main_weapon'] in ('Fists', 'Sharp Stick'):
		extra_damage += 5 * player['specialty2_level']
	

	#### BATTLE #####
	enemy_attack_1 = [' leaps and ', ' rolls and ', ' bellows and ', ' roars and ', ' dives and ', ' screams and ']
	enemy_attack_2 = ['vicously strikes you in the ', 'punches you in the ', 'kicks you in the ', 'elbows you in a ', 'slashes you in the ', 'stabs you in the ', 'hits you in the ', 'pokes you in the ']
	enemy_attack_3 = ['eye', 'face', 'stomach', 'head', 'mouth', 'throat', 'leg', 'arm', 'chest', 'nose', 'foot', 'hand', 'snozzle']
	scream = ['You scream ', 'You shout in pain ', 'You roar in anger ', 'You grunt in pain ', '']
	b = True
	while b == True:
		print(BOLD + UNDERLINE + GREEN + "LIFE: " + str(player['life']) + CYAN + ' | ' + RED + enemy.type + ' LIFE: ' + str(enemy.life) + Style.RESET_ALL)
		util.slow_print(CYAN + enemy.name + random.choice(enemy_attack_1) + random.choice(enemy_attack_2) + random.choice(enemy_attack_3))
		block = random.randint(1,3)
		damage_taken = random.randint(enemy.min_damage, enemy.max_damage)
		if block == 1:
			print(GREEN + "You block!")
			damage_taken -= player['shield_defense']
		damage_taken -= random.randint(player['armor_min'], player['armor_max'])
		util.slow_print(RED + random.choice(scream) + 'and take ' + str(damage_taken) + ' damage')
		player['life'] -= damage_taken
		
		if player['main_weapon'] == 'Octopus':
			damage_given = random.randint(1,8) * 8 + extra_damage
		else:
			damage_given = random.randint(player['main_weapon_min'], player['main_weapon_max']) + extra_damage
		block = random.randint(1,3)
		if block == 1:
			damage_given -= enemy.block
		damage_given -= random.randint(enemy.min_defense, enemy.max_defense)
		util.slow_print("You attack with your " + player['main_weapon'] + " and inflict " + str(damage_given) + ' damage')
		if damage_given <= 0:
			print("Enemy takes no damage!")
		else:
			enemy.life -= damage_given
		if enemy.life <= 0:
			print("Enemy defeated!")
			player['mission16'] = True
			## get loot
			t = random.randint(1,5)
			loot = ''
			if t == 5:
				loot = enemy.weapon
				util.slow_print("You looted the body and got a " + loot)
				player['weapons'].append(loot)
			elif t == 4:
				loot = enemy.defense
				if loot in ('Armor', 'Fire Armor', 'Wooden Armor', 'Kraveb Chest Plate', 'Ice Armor', 'Thorg War Armor', 'Chainmail'):
					util.slow_print("You looted the body and got a " + loot)
					player['armors'].append(loot)
				else:
					util.slow_print("You looted the body and got a " + loot)
					player['shields'].append(loot)
			else:
				loot = enemy.loot
				util.slow_print("You looted the body and got " + loot)
				player['monster_parts'].append(loot)
			player['kills'].append(enemy.type)
			database.save(player)
			input()
			b = False
			break
		elif player['life'] <= 0:
			print("You have been defeated...")
			input()
			b = False
			break
		i = input("[1] Continue fighting | [2] Run away")
		if i == '2':
			b = False
		else:
			pass