-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
71 lines (48 loc) · 1.83 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import battle
import colorama
import os
import shop
import time
from colorama import Fore, Back, Style
colorama.init(autoreset=True)
print("If you can see this message, then the terminal is not being cleared properly.\nMake sure you are using the "
"correct program version for your operating system, or try using another IDE or run it in Command Prompt.")
try:
os.mkdir("save_data")
except OSError as error:
print(error)
os.system('cls') # clears terminal when running in Command Prompt
print(f"{Fore.GREEN}###################")
print(f"{Style.BRIGHT}{Fore.CYAN}«{Fore.YELLOW}«{Fore.BLUE}SUPER AUTO PETS{Fore.YELLOW}»{Fore.CYAN}»")
print(f"{Fore.GREEN}###################\n")
print("""In Super Auto Pets you build a team from a lovable cast of animals who will fight for you.
They each have unique abilities, so choose wisely who will join your team!\n""")
time.sleep(1)
input(f"{Style.BRIGHT}Press enter to start Arena Mode. ")
game_over = False
while not game_over:
if shop.turn <= 2:
pet_shop_stock = 3 # number of pets in shop initially, should go up as you level up
else:
pet_shop_stock = 4
shop.pet_shop(pet_shop_stock)
time.sleep(1)
if shop.turn == 1:
team_name = shop.create_team_name() # create team name
save_file = open("save_data/team_name.txt", "w")
save_file.write(team_name) # save team name in 'team_name.txt'
save_file.close()
time.sleep(1)
os.system('cls')
battle.init_enemy_team(team_name)
battle.battle_start()
shop.turn += 1
battle.enemy_team.clear()
input(f"\n{Style.BRIGHT}Press enter to continue. ")
os.system('cls')
if shop.lives <= 0:
print(f"{Style.BRIGHT}GAME LOST!")
game_over = True
if shop.wins == 10:
print(f"{Style.BRIGHT}GAME WON!")
game_over = True