Skip to content

Commit

Permalink
#23: Alguns fixes e teste de carregamento de pc
Browse files Browse the repository at this point in the history
  • Loading branch information
HeBatalha committed Nov 30, 2023
1 parent 4805693 commit e88b3fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions game/Banco/Pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def criarPc(self, personagem:int, nome,
conexao = self.db.conexao
cursor = conexao.cursor()
cursor.execute(f"""insert into pc values({personagem},'{nome}',{xp},
{vida},{lvl},{dinheiro},'{especie}',{forca},{defesa});""")
{vida},{lvl},{dinheiro},'{especie}',{forca},{defesa},{local});""")
conexao.commit()
return print("PC criado com sucesso")
except psycopg2.Error as e:
Expand Down Expand Up @@ -52,7 +52,8 @@ def consultarPCID(self,Personagem:int):
except psycopg2.Error as e:
print("Erro ao cosultar os PC's", e )
finally:
cursor.close()
cursor.close()
return consultarNPC

def deletarNPC(self, IDpersonagem:int):
try:
Expand Down
Binary file modified game/Banco/__pycache__/Database.cpython-310.pyc
Binary file not shown.
Binary file modified game/Banco/__pycache__/Pc.cpython-310.pyc
Binary file not shown.
9 changes: 9 additions & 0 deletions game/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
personagem = Personagem()
pc = Pc()

def CarregarJogo():
Save=input("\033[1;32mDigite o ID do seu personagem: \033[0m")
jogador=pc.consultarPCID(Save)
return jogador[0]

print("\033[1;31m _ _ _ ___ _ ")
print("| | | | | | / _ \ | | ")
print("| |_| | ___ _ __ __ _ __| | ___ / /_\ \_ _____ _ __ | |_ _ _ _ __ __ _ ")
Expand Down Expand Up @@ -56,7 +61,11 @@
criarPC.criarPc(pcID,pcNome,0,100,0,0,pcEspecie,5,0,0)

case'3':
jogador=CarregarJogo()


print("oi party")
print(jogador[1])
print("\n--------------------------------------------------------------------------------\n")
case '4':
print("Localização")
Expand Down

0 comments on commit e88b3fb

Please sign in to comment.