-
Notifications
You must be signed in to change notification settings - Fork 0
/
resources.py
135 lines (107 loc) · 5.06 KB
/
resources.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import string_utils
import player_utils
help_text = 'Placeholder to tell the player what the game is about and how to control the game.'
entry = """
+==============================================================================+
████████╗██╗░░░██╗██████╗░░█████╗░███╗░░██╗████████╗░██████╗
╚══██╔══╝╚██╗░██╔╝██╔══██╗██╔══██╗████╗░██║╚══██╔══╝██╔════╝
░░░██║░░░░╚████╔╝░██████╔╝███████║██╔██╗██║░░░██║░░░╚█████╗░
░░░██║░░░░░╚██╔╝░░██╔══██╗██╔══██║██║╚████║░░░██║░░░░╚═══██╗
░░░██║░░░░░░██║░░░██║░░██║██║░░██║██║░╚███║░░░██║░░░██████╔╝
░░░╚═╝░░░░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░╚═════╝░
+==============================================================================+
[New] Game
[Load] Game
[High] Scores
[Help]
[Exit]
"""
new_game_template = """
Welcome, commander {name}!
Are you ready to begin?
[Yes] [No] Return to Main[Menu]
"""
def new_game(name: str) -> str:
return new_game_template.format(name=name)
hub_template = """
+==============================================================================+
{robots}
+==============================================================================+
| Titanium: {titanium:<12d} |
+==============================================================================+
| [Ex]plore [Up]grade |
| [Save] [M]enu |
+==============================================================================+
"""
def hub(player: player_utils.Player) -> str:
return hub_template.format(
robots=string_utils.display_robots(player.robots),
titanium=player.score
)
menu = """
|==========================|
| MENU |
| |
| [Back] to game |
| Return to [Main] Menu |
| [Save] and exit |
| [Exit] game |
|==========================|
"""
robot = """
$ $$$$$$$ $
$$$$$ $$$$$
$$$$$$$
$$$ $$$
$ $
"""
upgrade_store = """
|================================|
| UPGRADE STORE |
| Price |
| [1] Titanium Scan 250 |
| [2] Enemy Encounter Scan 500 |
| [3] New Robot 1000 |
| |
| [Back] |
|================================|
"""
deploy_template = """
Deploying robots{encounter}
{location} explored successfully, {damage}.
Acquired {titanium} lumps of titanium
"""
def deploy(encounter: bool, target: "Target") -> str:
return deploy_template.format(
encounter='\nEnemy encounter' if encounter else '',
location=target.location,
damage='1 robot lost.' if encounter else 'with no damage taken',
titanium=target.titanium
).strip()
game_saved = """
|==============================|
| GAME SAVED SUCCESSFULLY |
|==============================|
"""
game_loaded = """
|==============================|
| GAME LOADED SUCCESSFULLY |
|==============================|
"""
purchase_enemy = "Purchase successful. You will now see how likely you will encounter an enemy at each found location."
purchase_titanium = "Purchase successful. You can now see how much titanium you can get from each found location."
purchase_robot = "Purchase successful. You now have an additional robot"
time_format = "%Y-%m-%d %H:%M"
upgrade_prices: dict[str, int] = {'1': 250, '2': 500, '3': 1000}
game_over = """
Deploying robots...
Enemy encounter!!!
Mission aborted, the last robot lost...
|==============================|
| GAME OVER! |
|==============================|
"""
no_locations = """
Nothing more in sight.
[Back]
"""