final corrections before submission

This commit is contained in:
Edoardo Vergerio
2026-09-06 17:42:44 +02:00
parent 268fda0a6b
commit f046d06e21
15 changed files with 487 additions and 248 deletions
+17 -18
View File
@@ -1,8 +1,5 @@
import random
import math
import game_data as gd
from core import Trainer
def Main():
@@ -19,11 +16,11 @@ def Main():
print(e)
print("Please try again...")
continue
trainer.print_trainer_info()
#trainer.print_trainer_info()
cpu_trainer = Trainer(name="CPU", starter_name=random.choice(gd.available_starter_names))
cpu_trainer = Trainer(name="CPU", starter_name=random.choice(gd.available_wild_pokemon_names), is_CPU=True)
print(f"CPU has chosen {cpu_trainer.get_active_pokemon().name} as their starter Pokemon!")
cpu_trainer.print_trainer_info()
#cpu_trainer.print_trainer_info()
continue_playing = True
while continue_playing:
selected_pokemon_combat_flag = False
@@ -42,7 +39,6 @@ def Main():
print(f"Choose a move for {player_pokemon.name} to use against {cpu_trainer.get_active_pokemon().name}:\n", player_pokemon.get_moves())
player_move_name = input("Choose:")
try:
#print the move selected by the player
print("Your selected move: ")
player_pokemon.checkout_move(player_move_name)
selected_combat_move_flag = True
@@ -50,21 +46,24 @@ def Main():
print(e)
print("Please try again...")
#make a combat
#combat
print('='*30)
print("BATTLE RESULTS:")
print("Your move:")
player_pokemon.useMove(player_move_name, cpu_trainer.get_active_pokemon())
player_pokemon.checkout_move(player_move_name)
print('-'*30)
print("CPU's pokemon")
cpu_trainer.get_active_pokemon().print_pokemon_info()
print('='*30)
print("Continue playing? (yes/no)")
response = input().strip().lower()
if response != "yes":
opponent_fainted = player_pokemon.useMove(player_move_name, cpu_trainer.get_active_pokemon())
#player_pokemon.checkout_move(player_move_name)
#print('-'*30)
#print("CPU's pokemon")
#cpu_trainer.get_active_pokemon().print_pokemon_info()
#print('='*30)
if opponent_fainted:
print("You won the battle!")
continue_playing = False
else:
print("Continue playing? (yes/no)")
response = input().strip().lower()
if response != "yes":
continue_playing = False
if __name__ == "__main__":