neelthee-mansion 3.21.9__py3-none-any.whl → 3.22.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- neelthee_mansion/Mansion_of_Amnesia.py +85 -118
- {neelthee_mansion-3.21.9.dist-info → neelthee_mansion-3.22.1.dist-info}/METADATA +1 -1
- {neelthee_mansion-3.21.9.dist-info → neelthee_mansion-3.22.1.dist-info}/RECORD +7 -7
- {neelthee_mansion-3.21.9.dist-info → neelthee_mansion-3.22.1.dist-info}/LICENSE.md +0 -0
- {neelthee_mansion-3.21.9.dist-info → neelthee_mansion-3.22.1.dist-info}/WHEEL +0 -0
- {neelthee_mansion-3.21.9.dist-info → neelthee_mansion-3.22.1.dist-info}/entry_points.txt +0 -0
- {neelthee_mansion-3.21.9.dist-info → neelthee_mansion-3.22.1.dist-info}/top_level.txt +0 -0
@@ -399,17 +399,44 @@ def start():
|
|
399
399
|
showInstructions()
|
400
400
|
|
401
401
|
|
402
|
+
def get_inventory_text():
|
403
|
+
the_inventory = [
|
404
|
+
itemnum.name for itemnum in player.inventory if isinstance(itemnum, item)
|
405
|
+
]
|
406
|
+
return f'\nInventory: %*BLUE*%{", ".join(the_inventory)}%*RESET*%; Money: {player.money}; XP: {player.xp}; Level: {player.Level}'
|
407
|
+
|
408
|
+
def show_player_info():
|
409
|
+
global info_label, root
|
410
|
+
root = tk.Tk()
|
411
|
+
root.title("Player Info")
|
412
|
+
|
413
|
+
info_text = get_inventory_text()
|
414
|
+
info_label = tk.Label(root, text=info_text)
|
415
|
+
info_label.pack()
|
416
|
+
|
417
|
+
update_button = tk.Button(root, text="Update Info", command=update_player_info)
|
418
|
+
update_button.pack()
|
419
|
+
|
420
|
+
root.mainloop()
|
421
|
+
|
422
|
+
def update_player_info():
|
423
|
+
info_text = get_inventory_text()
|
424
|
+
root.after(0, lambda: info_label.config(text=info_text))
|
425
|
+
|
426
|
+
def start_tkinter_thread():
|
427
|
+
thread = threading.Thread(target=show_player_info)
|
428
|
+
thread.daemon = True
|
429
|
+
thread.start()
|
430
|
+
|
431
|
+
|
402
432
|
def showStatus():
|
403
433
|
global player
|
404
434
|
|
405
435
|
# Display player's current status
|
406
436
|
text = f"\n---------------------------"
|
407
437
|
|
408
|
-
# Display the current
|
409
|
-
|
410
|
-
itemnum.name for itemnum in player.inventory if isinstance(itemnum, item)
|
411
|
-
]
|
412
|
-
text += f'\nInventory: %*BLUE*%{", ".join(the_inventory)}%*RESET*%; Money: {player.money}; XP: {player.xp}; Level: {player.Level}'
|
438
|
+
# Display the current stats
|
439
|
+
update_player_info()
|
413
440
|
|
414
441
|
# Display possible directions of travel
|
415
442
|
text = display_directions(text)
|
@@ -1149,19 +1176,55 @@ def initializer():
|
|
1149
1176
|
age_entry.delete(0, tk.END)
|
1150
1177
|
height_entry.delete(0, tk.END)
|
1151
1178
|
weight_entry.delete(0, tk.END)
|
1179
|
+
|
1180
|
+
def choose_background():
|
1181
|
+
background_window = tk.Toplevel(root)
|
1182
|
+
background_window.title("Choose Background")
|
1183
|
+
|
1184
|
+
tk.Label(background_window, text="Select a Background for Your Character:").pack()
|
1185
|
+
|
1186
|
+
background_listbox = tk.Listbox(background_window)
|
1187
|
+
for background in BACKGROUNDS.keys():
|
1188
|
+
background_listbox.insert(tk.END, background)
|
1189
|
+
background_listbox.pack()
|
1190
|
+
|
1191
|
+
def select_background():
|
1192
|
+
global player
|
1193
|
+
selected_index = background_listbox.curselection()
|
1194
|
+
if selected_index:
|
1195
|
+
background = list(BACKGROUNDS.keys())[selected_index[0]]
|
1196
|
+
background_skills = BACKGROUNDS[background]
|
1197
|
+
selected_character = {
|
1198
|
+
"name": name_entry.get(),
|
1199
|
+
"age": age_entry.get(),
|
1200
|
+
"height": height_entry.get(),
|
1201
|
+
"weight": weight_entry.get()
|
1202
|
+
}
|
1203
|
+
player = PC(
|
1204
|
+
selected_character["name"],
|
1205
|
+
selected_character["age"],
|
1206
|
+
background,
|
1207
|
+
1,
|
1208
|
+
"Solder",
|
1209
|
+
selected_character["height"],
|
1210
|
+
selected_character["weight"],
|
1211
|
+
Skills=background_skills,
|
1212
|
+
CURRENTROOM="Hall"
|
1213
|
+
)
|
1214
|
+
start_game()
|
1215
|
+
|
1216
|
+
select_button = tk.Button(background_window, text="Select", command=select_background)
|
1217
|
+
select_button.pack()
|
1152
1218
|
|
1153
1219
|
def exit_game():
|
1154
|
-
|
1220
|
+
exit()
|
1155
1221
|
|
1156
|
-
def
|
1157
|
-
selected_character = {
|
1158
|
-
"name": name_entry.get(),
|
1159
|
-
"age": age_entry.get(),
|
1160
|
-
"height": height_entry.get(),
|
1161
|
-
"weight": weight_entry.get()
|
1162
|
-
}
|
1163
|
-
print("Selected Character:", selected_character)
|
1222
|
+
def continue_setup():
|
1164
1223
|
ask_color_coding()
|
1224
|
+
|
1225
|
+
def start_game():
|
1226
|
+
# I will add more logic for starting the game later
|
1227
|
+
root.destroy()
|
1165
1228
|
|
1166
1229
|
def ask_color_coding():
|
1167
1230
|
color_window = tk.Toplevel(root)
|
@@ -1171,8 +1234,10 @@ def initializer():
|
|
1171
1234
|
tk.Button(color_window, text="No", command=lambda: set_color_coding(False)).pack()
|
1172
1235
|
|
1173
1236
|
def set_color_coding(choice):
|
1174
|
-
|
1237
|
+
global color_coding
|
1238
|
+
color_coding = choice
|
1175
1239
|
# Add your logic for enabling/disabling color coding here
|
1240
|
+
choose_background()
|
1176
1241
|
|
1177
1242
|
root = tk.Tk()
|
1178
1243
|
root.title("Character Creation")
|
@@ -1199,8 +1264,8 @@ def initializer():
|
|
1199
1264
|
custom_button = tk.Button(root, text="Custom Character", command=custom_character)
|
1200
1265
|
custom_button.pack()
|
1201
1266
|
|
1202
|
-
|
1203
|
-
|
1267
|
+
continue_button = tk.Button(root, text="Continue", command=continue_setup)
|
1268
|
+
continue_button.pack()
|
1204
1269
|
|
1205
1270
|
exit_button = tk.Button(root, text="Exit Game", command=exit_game)
|
1206
1271
|
exit_button.pack()
|
@@ -1209,107 +1274,6 @@ def initializer():
|
|
1209
1274
|
|
1210
1275
|
create_main_menu()
|
1211
1276
|
|
1212
|
-
Standord_Player = loop_til_valid_input(
|
1213
|
-
"Do you want to use a premade character?", "you didn't answer Y or N.", Y_N
|
1214
|
-
).value
|
1215
|
-
|
1216
|
-
if Standord_Player:
|
1217
|
-
while True:
|
1218
|
-
type_text("Who do you want to play as?", colorTrue=False)
|
1219
|
-
print(df)
|
1220
|
-
selected_character = loop_til_valid_input(
|
1221
|
-
"Who do you want to play as? (please select the number to the left of there stats)",
|
1222
|
-
"That wasn't one of the characters. Please choose one.",
|
1223
|
-
int,
|
1224
|
-
)
|
1225
|
-
lstIndex = last_index(CHARACTERSLIST)
|
1226
|
-
if selected_character <= lstIndex:
|
1227
|
-
character_info = CHARACTERSLIST[selected_character]
|
1228
|
-
name = character_info["name"]
|
1229
|
-
age = character_info["age"]
|
1230
|
-
height = character_info["height"]
|
1231
|
-
weight = character_info["weight(LBs)"]
|
1232
|
-
break
|
1233
|
-
else:
|
1234
|
-
type_text(colorTrue=False)
|
1235
|
-
|
1236
|
-
else:
|
1237
|
-
type_text(
|
1238
|
-
"You will now have to enter a name, age, height, and weight. Please enter the height in this format: _ft _. These will be used throughout the game.",
|
1239
|
-
colorTrue=False,
|
1240
|
-
)
|
1241
|
-
|
1242
|
-
name = loop_til_valid_input(
|
1243
|
-
"What is your name?",
|
1244
|
-
"You didn't enter a string. Please enter a string.",
|
1245
|
-
str,
|
1246
|
-
)
|
1247
|
-
age = loop_til_valid_input(
|
1248
|
-
"What is your age (in whole years)?",
|
1249
|
-
"You didn't enter an integer. Please enter an integer.",
|
1250
|
-
int,
|
1251
|
-
)
|
1252
|
-
height = loop_til_valid_input(
|
1253
|
-
"What is your height?",
|
1254
|
-
"You didn't enter your height in the correct format. Please enter your height in the correct format.",
|
1255
|
-
Height,
|
1256
|
-
)
|
1257
|
-
weight = loop_til_valid_input(
|
1258
|
-
"What is your weight (in lbs)?",
|
1259
|
-
"You didn't enter an integer. Please enter an integer.",
|
1260
|
-
int,
|
1261
|
-
)
|
1262
|
-
|
1263
|
-
color_coding = loop_til_valid_input(
|
1264
|
-
"Do you want color coding (Y/N)?", "you didn't answer Y or N.", Y_N
|
1265
|
-
).value
|
1266
|
-
|
1267
|
-
background_name = []
|
1268
|
-
background_skills = []
|
1269
|
-
|
1270
|
-
while True:
|
1271
|
-
type_text("") # Prints an empty line
|
1272
|
-
type_text("0. Random")
|
1273
|
-
|
1274
|
-
# Display each background with its skills formatted correctly.
|
1275
|
-
for idx, (background_name, background_skills) in enumerate(BACKGROUNDS.items()):
|
1276
|
-
formatted_skills = ", ".join(background_skills)
|
1277
|
-
type_text(f"{idx + 1}. {background_name} - {formatted_skills}")
|
1278
|
-
|
1279
|
-
# Prompt the user to pick a background by number.
|
1280
|
-
background = loop_til_valid_input(
|
1281
|
-
"What background do you want? (please select the number to the left of them)",
|
1282
|
-
"You didn't pick one",
|
1283
|
-
int,
|
1284
|
-
)
|
1285
|
-
|
1286
|
-
length = len(BACKGROUNDS)
|
1287
|
-
if 1 <= background <= length:
|
1288
|
-
# Get the background name and skills based on user choice.
|
1289
|
-
background_name = list(BACKGROUNDS.keys())[background - 1]
|
1290
|
-
background_skills = BACKGROUNDS[background_name]
|
1291
|
-
break
|
1292
|
-
elif background == 0:
|
1293
|
-
# Randomly select a background and get its associated skills.
|
1294
|
-
background_name = choice(list(BACKGROUNDS.keys()))
|
1295
|
-
background_skills = BACKGROUNDS[background_name]
|
1296
|
-
break
|
1297
|
-
else:
|
1298
|
-
type_text("You didn't pick one")
|
1299
|
-
|
1300
|
-
# start the player in the Hall and sets up everything else
|
1301
|
-
player = PC(
|
1302
|
-
name,
|
1303
|
-
age,
|
1304
|
-
background,
|
1305
|
-
1,
|
1306
|
-
"Soldier",
|
1307
|
-
height,
|
1308
|
-
weight,
|
1309
|
-
CURRENTROOM="Hall",
|
1310
|
-
Skills=background_skills,
|
1311
|
-
)
|
1312
|
-
|
1313
1277
|
|
1314
1278
|
def main():
|
1315
1279
|
global player, color_coding
|
@@ -1320,6 +1284,9 @@ def main():
|
|
1320
1284
|
# shows the instructions
|
1321
1285
|
start()
|
1322
1286
|
|
1287
|
+
# starts the tkinter thread that shows the player's stats
|
1288
|
+
start_tkinter_thread()
|
1289
|
+
|
1323
1290
|
# loop forever while the player wants to play
|
1324
1291
|
while True:
|
1325
1292
|
command()
|
@@ -1,5 +1,5 @@
|
|
1
1
|
neelthee_mansion/Books.py,sha256=Zs6GOi12vrikne-E37LdrLNRb6CyUogOCDApDGFj6Ls,26168
|
2
|
-
neelthee_mansion/Mansion_of_Amnesia.py,sha256
|
2
|
+
neelthee_mansion/Mansion_of_Amnesia.py,sha256=-ts-IgcAwRbQrj_A40KmApKTK0u1Wp9IazIn7RYGzBE,52843
|
3
3
|
neelthee_mansion/Quests.py,sha256=pUlru2RugP57MACQORZaF_X9lsbefTdPYTSO474phgo,2791
|
4
4
|
neelthee_mansion/Rooms.py,sha256=CgenMX9ssTCWbDFopX6GHhNDnRYF5MpaDufWvt5fPwU,86025
|
5
5
|
neelthee_mansion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -8,9 +8,9 @@ neelthee_mansion/all_game_utils.py,sha256=AasunTkFmgAqt9ZIoYmymi4R7leBe4ubW-C1ts
|
|
8
8
|
neelthee_mansion/creatures.py,sha256=vUR8PmdiftCFBCGJbHkCT4AMUPvqwouDGQ4ye2fiPCw,20910
|
9
9
|
neelthee_mansion/items.py,sha256=--DtMCZrurDAe3S-gB5DXAul_kmG9BGB0QmBY2-Fphc,6383
|
10
10
|
neelthee_mansion/utils.py,sha256=GaCkein6dppeufYfBMk59gHAE2b4p9TJW2MsRjyyFvQ,13702
|
11
|
-
neelthee_mansion-3.
|
12
|
-
neelthee_mansion-3.
|
13
|
-
neelthee_mansion-3.
|
14
|
-
neelthee_mansion-3.
|
15
|
-
neelthee_mansion-3.
|
16
|
-
neelthee_mansion-3.
|
11
|
+
neelthee_mansion-3.22.1.dist-info/LICENSE.md,sha256=CV8XGZaCyyAMdbkYFQUjb8AjBq9vkoyqdZCq1_hetms,1105
|
12
|
+
neelthee_mansion-3.22.1.dist-info/METADATA,sha256=w7cBKCPaHUKdwHsyIdjuPRLQLvo4_UvK0pQPryzwj6Q,1756
|
13
|
+
neelthee_mansion-3.22.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
14
|
+
neelthee_mansion-3.22.1.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
|
15
|
+
neelthee_mansion-3.22.1.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
|
16
|
+
neelthee_mansion-3.22.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|