final corrections before submission
This commit is contained in:
+1
-1
@@ -178,7 +178,7 @@ class Trainer:
|
||||
raise ValueError(f"{item_name} is not an available item.")
|
||||
else:
|
||||
if self.items[item_name] > 0:
|
||||
self.items[item_name] -= 1 #use the item
|
||||
self.items[item_name] -= 1
|
||||
print(f"Used {item_name}. Remaining: {self.items[item_name]}")
|
||||
if item_name == "potions":
|
||||
self.active_pokemon.curr_hp += 20
|
||||
|
||||
+3
-4
@@ -160,7 +160,7 @@ def Main():
|
||||
print("Adding potions and pokeballs to your inventory...")
|
||||
trainer.items = {"potions": 10, "pokeball": 10}
|
||||
print("Your character is ready!")
|
||||
trainer.print_trainer_info()
|
||||
#trainer.print_trainer_info()
|
||||
player_created_flag = True
|
||||
print(f"Welcome {trainer.name}! Your adventure begins now!")
|
||||
except ValueError as e:
|
||||
@@ -201,9 +201,9 @@ def Main():
|
||||
battle_prob = random.uniform(0, 1)
|
||||
print(f"Battle probability: {battle_prob:.2f}")
|
||||
if battle_prob < 0.8:
|
||||
print("A wild Pokemon appeared!")
|
||||
cpu_trainer = Trainer(name='CPU',starter_name=gd.available_wild_pokemon_names[random.randint(0,len(gd.available_wild_pokemon_names)-1)],is_CPU=True)
|
||||
print(cpu_trainer.get_active_pokemon().print_pokemon_info())
|
||||
print(f"A wild {cpu_trainer.get_active_pokemon().name} appeared!")
|
||||
#print(cpu_trainer.get_active_pokemon().print_pokemon_info())
|
||||
game_status = 'battle'
|
||||
Battle(trainer,cpu_trainer)
|
||||
else:
|
||||
@@ -224,7 +224,6 @@ def Main():
|
||||
else:
|
||||
print("You exited the Pokemon Center.")
|
||||
game_status = 'story'
|
||||
# Add Pokemon Center logic here
|
||||
elif game_status == 'pokemon_store':
|
||||
print("You are in the Pokemon Store. You can buy items here.")
|
||||
restore_items_flag = input("Type 'yes' to restore your items: ").strip().lower()
|
||||
|
||||
Reference in New Issue
Block a user