neelthee-mansion 3.20.21__py3-none-any.whl → 3.21.0__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.
@@ -3,6 +3,7 @@ from .creatures import *
3
3
  from .items import *
4
4
  from .Quests import *
5
5
  from .all_game_utils import *
6
+ import tkinter as tk
6
7
 
7
8
 
8
9
  GameState = {
@@ -497,6 +498,8 @@ def Examine(*Args):
497
498
  elif isinstance(_, Recorder):
498
499
  type_text("This device records sound. The current message is:")
499
500
  type_text(_.message)
501
+ else:
502
+ type_text(_.value)
500
503
  elif Name in ROOMS[player.CURRENTROOM]["directions"]: # Check exits in the room
501
504
  door = ROOMS[player.CURRENTROOM]["directions"][Name]
502
505
  if isinstance(door, Door):
@@ -1112,106 +1115,237 @@ def handle_guard_action(guard):
1112
1115
  def initializer():
1113
1116
  global color_coding, player, CHARACTERSLIST
1114
1117
  df = pd.DataFrame(CHARACTERSLIST)
1115
- Standord_Player = loop_til_valid_input(
1116
- "Do you want to use a premade character?", "you didn't answer Y or N.", Y_N
1117
- ).value
1118
-
1119
- if Standord_Player:
1120
- while True:
1121
- type_text("Who do you want to play as?", colorTrue=False)
1122
- print(df)
1123
- selected_character = loop_til_valid_input(
1124
- "Who do you want to play as? (please select the number to the left of there stats)",
1125
- "That wasn't one of the characters. Please choose one.",
1126
- int,
1127
- )
1128
- lstIndex = last_index(CHARACTERSLIST)
1129
- if selected_character <= lstIndex:
1130
- character_info = CHARACTERSLIST[selected_character]
1131
- name = character_info["name"]
1132
- age = character_info["age"]
1133
- height = character_info["height"]
1134
- weight = character_info["weight(LBs)"]
1135
- break
1136
- else:
1137
- type_text(colorTrue=False)
1138
1118
 
1139
- else:
1140
- type_text(
1141
- "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.",
1142
- colorTrue=False,
1143
- )
1144
-
1145
- name = loop_til_valid_input(
1146
- "What is your name?",
1147
- "You didn't enter a string. Please enter a string.",
1148
- str,
1149
- )
1150
- age = loop_til_valid_input(
1151
- "What is your age (in whole years)?",
1152
- "You didn't enter an integer. Please enter an integer.",
1153
- int,
1154
- )
1155
- height = loop_til_valid_input(
1156
- "What is your height?",
1157
- "You didn't enter your height in the correct format. Please enter your height in the correct format.",
1158
- Height,
1159
- )
1160
- weight = loop_til_valid_input(
1161
- "What is your weight (in lbs)?",
1162
- "You didn't enter an integer. Please enter an integer.",
1163
- int,
1164
- )
1165
-
1166
- color_coding = loop_til_valid_input(
1167
- "Do you want color coding (Y/N)?", "you didn't answer Y or N.", Y_N
1168
- ).value
1169
-
1170
- background_name = []
1171
- background_skills = []
1172
-
1173
- while True:
1174
- type_text("") # Prints an empty line
1175
- type_text("0. Random")
1176
-
1177
- # Display each background with its skills formatted correctly.
1178
- for idx, (background_name, background_skills) in enumerate(BACKGROUNDS.items()):
1179
- formatted_skills = ", ".join(background_skills)
1180
- type_text(f"{idx + 1}. {background_name} - {formatted_skills}")
1181
-
1182
- # Prompt the user to pick a background by number.
1183
- background = loop_til_valid_input(
1184
- "What background do you want? (please select the number to the left of them)",
1185
- "You didn't pick one",
1186
- int,
1187
- )
1188
-
1189
- length = len(BACKGROUNDS)
1190
- if 1 <= background <= length:
1191
- # Get the background name and skills based on user choice.
1192
- background_name = list(BACKGROUNDS.keys())[background - 1]
1193
- background_skills = BACKGROUNDS[background_name]
1194
- break
1195
- elif background == 0:
1196
- # Randomly select a background and get its associated skills.
1197
- background_name = choice(list(BACKGROUNDS.keys()))
1198
- background_skills = BACKGROUNDS[background_name]
1199
- break
1200
- else:
1201
- type_text("You didn't pick one")
1202
-
1203
- # start the player in the Hall and sets up everything else
1204
- player = PC(
1205
- name,
1206
- age,
1207
- background,
1208
- 1,
1209
- "Soldier",
1210
- height,
1211
- weight,
1212
- CURRENTROOM="Hall",
1213
- Skills=background_skills,
1214
- )
1119
+ # A tkinter window that asks these questions, instead of the console.Include a button that says "Exit Game". When the button is clicked, the game exits. Include a button that says "premade character". When the button is clicked, a new window opens that lets you choose one of the premade characters from teh CHARACTERSLIST var. Include a button that says "custom character". When the button is clicked, a new window opens that asks them for a name, age, hight, and waight(LBs).
1120
+ def create_main_menu():
1121
+ def select_character():
1122
+ selected_index = character_listbox.curselection()
1123
+ if selected_index:
1124
+ selected_character = CHARACTERSLIST[selected_index[0]]
1125
+ name_entry.delete(0, tk.END)
1126
+ name_entry.insert(0, selected_character['name'])
1127
+ age_entry.delete(0, tk.END)
1128
+ age_entry.insert(0, selected_character['age'])
1129
+ height_entry.delete(0, tk.END)
1130
+ height_entry.insert(0, selected_character['height'])
1131
+ weight_entry.delete(0, tk.END)
1132
+ weight_entry.insert(0, selected_character['weight(LBs)'])
1133
+ character_window.destroy()
1134
+
1135
+ def show_premade_characters():
1136
+ global character_window, character_listbox
1137
+ character_window = tk.Toplevel(root)
1138
+ character_window.title("Select Premade Character")
1139
+ character_listbox = tk.Listbox(character_window, width=50)
1140
+ for character in CHARACTERSLIST:
1141
+ character_info = f"Name: {character['name']}, Age: {character['age']}, Height: {character['height']}, Weight: {character['weight(LBs)']} LBs"
1142
+ character_listbox.insert(tk.END, character_info)
1143
+ character_listbox.pack()
1144
+ select_button = tk.Button(character_window, text="Select", command=select_character)
1145
+ select_button.pack()
1146
+
1147
+ def custom_character():
1148
+ name_entry.delete(0, tk.END)
1149
+ age_entry.delete(0, tk.END)
1150
+ height_entry.delete(0, tk.END)
1151
+ weight_entry.delete(0, tk.END)
1152
+
1153
+ def choose_background():
1154
+ background_window = tk.Toplevel(root)
1155
+ background_window.title("Choose Background")
1156
+
1157
+ tk.Label(background_window, text="Select a Background for Your Character:").pack()
1158
+
1159
+ background_listbox = tk.Listbox(background_window)
1160
+ for background in BACKGROUNDS.keys():
1161
+ background_listbox.insert(tk.END, background)
1162
+ background_listbox.pack()
1163
+
1164
+ def select_background():
1165
+ selected_index = background_listbox.curselection()
1166
+ if selected_index:
1167
+ background = list(BACKGROUNDS.keys())[selected_index[0]]
1168
+ background_skills = BACKGROUNDS[background]
1169
+ global player
1170
+ selected_character = {
1171
+ "name": name_entry.get(),
1172
+ "age": age_entry.get(),
1173
+ "height": height_entry.get(),
1174
+ "weight": weight_entry.get()
1175
+ }
1176
+ player = PC(
1177
+ selected_character["name"],
1178
+ selected_character["age"],
1179
+ background,
1180
+ 1,
1181
+ "Solder",
1182
+ selected_character["height"],
1183
+ selected_character["weight"],
1184
+ Skills=background_skills
1185
+ )
1186
+ start_game()
1187
+
1188
+ select_button = tk.Button(background_window, text="Select", command=select_background)
1189
+ select_button.pack()
1190
+
1191
+ def exit_game():
1192
+ exit()
1193
+
1194
+ def continue_setup():
1195
+ ask_color_coding()
1196
+
1197
+ def start_game():
1198
+ # I will add more logic for starting the game later
1199
+ root.destroy()
1200
+
1201
+ def ask_color_coding():
1202
+ color_window = tk.Toplevel(root)
1203
+ color_window.title("Color Coding")
1204
+ tk.Label(color_window, text="Do you want color coding?").pack()
1205
+ tk.Button(color_window, text="Yes", command=lambda: set_color_coding(True)).pack()
1206
+ tk.Button(color_window, text="No", command=lambda: set_color_coding(False)).pack()
1207
+
1208
+ def set_color_coding(choice):
1209
+ global color_coding
1210
+ color_coding = choice
1211
+ # Add your logic for enabling/disabling color coding here
1212
+ choose_background()
1213
+
1214
+ root = tk.Tk()
1215
+ root.title("Character Creation")
1216
+
1217
+ tk.Label(root, text="Name:").pack()
1218
+ name_entry = tk.Entry(root)
1219
+ name_entry.pack()
1220
+
1221
+ tk.Label(root, text="Age:").pack()
1222
+ age_entry = tk.Entry(root)
1223
+ age_entry.pack()
1224
+
1225
+ tk.Label(root, text="Height:").pack()
1226
+ height_entry = tk.Entry(root)
1227
+ height_entry.pack()
1228
+
1229
+ tk.Label(root, text="Weight (LBs):").pack()
1230
+ weight_entry = tk.Entry(root)
1231
+ weight_entry.pack()
1232
+
1233
+ premade_button = tk.Button(root, text="Premade Character", command=show_premade_characters)
1234
+ premade_button.pack()
1235
+
1236
+ custom_button = tk.Button(root, text="Custom Character", command=custom_character)
1237
+ custom_button.pack()
1238
+
1239
+ continue_button = tk.Button(root, text="Continue", command=continue_setup)
1240
+ continue_button.pack()
1241
+
1242
+ exit_button = tk.Button(root, text="Exit Game", command=exit_game)
1243
+ exit_button.pack()
1244
+
1245
+ root.mainloop()
1246
+
1247
+ create_main_menu()
1248
+
1249
+ #Standord_Player = loop_til_valid_input(
1250
+ # "Do you want to use a premade character?", "you didn't answer Y or N.", Y_N
1251
+ #).value
1252
+
1253
+ #if Standord_Player:
1254
+ # while True:
1255
+ # type_text("Who do you want to play as?", colorTrue=False)
1256
+ # print(df)
1257
+ # selected_character = loop_til_valid_input(
1258
+ # "Who do you want to play as? (please select the number to the left of there stats)",
1259
+ # "That wasn't one of the characters. Please choose one.",
1260
+ # int,
1261
+ # )
1262
+ # lstIndex = last_index(CHARACTERSLIST)
1263
+ # if selected_character <= lstIndex:
1264
+ # character_info = CHARACTERSLIST[selected_character]
1265
+ # name = character_info["name"]
1266
+ # age = character_info["age"]
1267
+ # height = character_info["height"]
1268
+ # weight = character_info["weight(LBs)"]
1269
+ # break
1270
+ # else:
1271
+ # type_text(colorTrue=False)
1272
+
1273
+ #else:
1274
+ # type_text(
1275
+ # "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.",
1276
+ # colorTrue=False,
1277
+ # )
1278
+
1279
+ # name = loop_til_valid_input(
1280
+ # "What is your name?",
1281
+ # "You didn't enter a string. Please enter a string.",
1282
+ # str,
1283
+ # )
1284
+ # age = loop_til_valid_input(
1285
+ # "What is your age (in whole years)?",
1286
+ # "You didn't enter an integer. Please enter an integer.",
1287
+ # int,
1288
+ # )
1289
+ # height = loop_til_valid_input(
1290
+ # "What is your height?",
1291
+ # "You didn't enter your height in the correct format. Please enter your height in the correct format.",
1292
+ # Height,
1293
+ # )
1294
+ # weight = loop_til_valid_input(
1295
+ # "What is your weight (in lbs)?",
1296
+ # "You didn't enter an integer. Please enter an integer.",
1297
+ # int,
1298
+ # )
1299
+
1300
+ #color_coding = loop_til_valid_input(
1301
+ # "Do you want color coding (Y/N)?", "you didn't answer Y or N.", Y_N
1302
+ #).value
1303
+
1304
+ #background_name = []
1305
+ #background_skills = []
1306
+
1307
+ #while True:
1308
+ # type_text("") # Prints an empty line
1309
+ # type_text("0. Random")
1310
+
1311
+ # # Display each background with its skills formatted correctly.
1312
+ # for idx, (background_name, background_skills) in enumerate(BACKGROUNDS.items()):
1313
+ # formatted_skills = ", ".join(background_skills)
1314
+ # type_text(f"{idx + 1}. {background_name} - {formatted_skills}")
1315
+
1316
+ # # Prompt the user to pick a background by number.
1317
+ # background = loop_til_valid_input(
1318
+ # "What background do you want? (please select the number to the left of them)",
1319
+ # "You didn't pick one",
1320
+ # int,
1321
+ # )
1322
+
1323
+ # length = len(BACKGROUNDS)
1324
+ # if 1 <= background <= length:
1325
+ # # Get the background name and skills based on user choice.
1326
+ # background_name = list(BACKGROUNDS.keys())[background - 1]
1327
+ # background_skills = BACKGROUNDS[background_name]
1328
+ # break
1329
+ # elif background == 0:
1330
+ # # Randomly select a background and get its associated skills.
1331
+ # background_name = choice(list(BACKGROUNDS.keys()))
1332
+ # background_skills = BACKGROUNDS[background_name]
1333
+ # break
1334
+ # else:
1335
+ # type_text("You didn't pick one")
1336
+
1337
+ ## start the player in the Hall and sets up everything else
1338
+ #player = PC(
1339
+ # name,
1340
+ # age,
1341
+ # background,
1342
+ # 1,
1343
+ # "Soldier",
1344
+ # height,
1345
+ # weight,
1346
+ # CURRENTROOM="Hall",
1347
+ # Skills=background_skills,
1348
+ #)
1215
1349
 
1216
1350
 
1217
1351
  def main():
neelthee_mansion/Rooms.py CHANGED
@@ -648,6 +648,7 @@ You notice a "
648
648
  "directions": {
649
649
  "south": Door("Basement 3"),
650
650
  "east": Door("Basement 1"),
651
+ "north": Door("DND"),
651
652
  },
652
653
  "items": {
653
654
  "torch": item("torch"),
@@ -659,7 +660,7 @@ You notice a "
659
660
  "info": "You are in a dimly lit underground armoury (all the light in the room comes from 3 %*BLUE*%torch%*RESET*%es on the walls) with 2 racks full of damaged weapons,\n\
660
661
  %*RED*%rack-1%*RESET*% has damaged bows and %*RED*%rack-2%*RESET*% has damaged spears.",
661
662
  "map": """
662
- █████████
663
+ ██████║██
663
664
  █╦ █
664
665
  █ ╦█
665
666
  █ █
@@ -805,6 +806,65 @@ You notice a "
805
806
  'Is it just me or are the first letters of all of those book names spelling the words "He\'s watching you"',
806
807
  ],
807
808
  },
809
+ 'DND': {
810
+ 'room type': 'type',
811
+ 'position': (0, 0, 0),
812
+ 'discovered': False,
813
+ 'directions': {
814
+ 'north': Door('Room name'),
815
+ 'south': Door("Basement Armoury"),
816
+ },
817
+ 'creatures stats': [
818
+ NPC(
819
+ "dungeon master",
820
+ 1000,
821
+ 100,
822
+ type=creature_type("god", "dungeon master"),
823
+ responses={
824
+ "introduction": "I see you’ve come to the next stage of your quest, player. But remember—your choices, even the smallest ones, will shape your fate.\
825
+ Oh and before I forget, If you go through the door to the north, there wil be no turning back. You will ether have to join Neel-thee or fight him.",
826
+ "map": "Oh, the map! That's the map of one of my favourite places! Sword Coast is an amazing place to be! I hope you can go there one day.",
827
+ "you": "Me? I'm a prymodrial being from beyond the stars that can alter reality. You can call me the Dungeon Master."
828
+ },
829
+ keyword_variations={
830
+ "introduction": ["hello", "hi ", "greetings", "hey"],
831
+ "map": ["the map", "map", "sword coast", "strange map"],
832
+ "you": ["you"],
833
+ },
834
+ generic_response="I will not answer that question at this time."
835
+ ),
836
+ ],
837
+ 'containers': {
838
+ 'table': container([item("unknown map", "map", "This map is of some strange land, far away. At the top of the map, it says 'Sword Coast.'")]),
839
+ },
840
+ 'info': 'You are in a dimly lit room with a table in the middle of it, and a looming figure to your left. The figure has a name badge that says "%*BROWN*%dungeon master%*RESET*%".',
841
+ 'map': '''
842
+ ████║████
843
+ █ █
844
+ █ █
845
+ █ ┬┬┬ █
846
+ █ ┬┬┬ █
847
+ █ ┬┬┬ █
848
+ █ █
849
+ █ █
850
+ ██████║██''',
851
+ 'random_events': [
852
+ RandomEvent(
853
+ name='rumble',
854
+ probability=0.4, # Adjust this for the probability of the event running (e.g., 0.1 is 10% chance)
855
+ condition=lambda player: True, # Condition under which the event can occur
856
+ effect=lambda player: type_text("You hear a strange rumbling sound."), # Define the effect of the event
857
+ )
858
+ ],
859
+ 'random_events': [
860
+ RandomEvent(
861
+ name='fire',
862
+ probability=0.3, # Adjust this for the probability of the event running (e.g., 0.1 is 10% chance)
863
+ condition=lambda player: True, # Condition under which the event can occur
864
+ effect=lambda player: type_text("Fire comes gushing out of a crack in the roof and into the wall."), # Define the effect of the event
865
+ )
866
+ ],
867
+ },
808
868
  "Cavern 1": {
809
869
  "room type": "cavern",
810
870
  "position": (-2, 0, 0),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: neelthee_mansion
3
- Version: 3.20.21
3
+ Version: 3.21.0
4
4
  Summary: A text-based adventure game set in Neel-thee’s mansion.
5
5
  Home-page: https://github.com/Flameblade375/neelthee_mansion
6
6
  Author: Alexander.E.F
@@ -0,0 +1,16 @@
1
+ neelthee_mansion/Books.py,sha256=Zs6GOi12vrikne-E37LdrLNRb6CyUogOCDApDGFj6Ls,26168
2
+ neelthee_mansion/Mansion_of_Amnesia.py,sha256=WaHjdJVck5mdm2SqWq6Mg1eGAt9PXWQXhyc5Uu6ritU,55875
3
+ neelthee_mansion/Quests.py,sha256=pUlru2RugP57MACQORZaF_X9lsbefTdPYTSO474phgo,2791
4
+ neelthee_mansion/Rooms.py,sha256=CgenMX9ssTCWbDFopX6GHhNDnRYF5MpaDufWvt5fPwU,86025
5
+ neelthee_mansion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ neelthee_mansion/__main__.py,sha256=OIAWZ04le70DyjtR4hlmK9csHej7EHxeUrMoNnM-Vjc,95
7
+ neelthee_mansion/all_game_utils.py,sha256=AasunTkFmgAqt9ZIoYmymi4R7leBe4ubW-C1ts0Qclo,351
8
+ neelthee_mansion/creatures.py,sha256=vUR8PmdiftCFBCGJbHkCT4AMUPvqwouDGQ4ye2fiPCw,20910
9
+ neelthee_mansion/items.py,sha256=--DtMCZrurDAe3S-gB5DXAul_kmG9BGB0QmBY2-Fphc,6383
10
+ neelthee_mansion/utils.py,sha256=GaCkein6dppeufYfBMk59gHAE2b4p9TJW2MsRjyyFvQ,13702
11
+ neelthee_mansion-3.21.0.dist-info/LICENSE.md,sha256=CV8XGZaCyyAMdbkYFQUjb8AjBq9vkoyqdZCq1_hetms,1105
12
+ neelthee_mansion-3.21.0.dist-info/METADATA,sha256=Rd6EuKCPy2fz3nhfiCGU8pTZpTwtmgMQgrjw33qDBSI,1980
13
+ neelthee_mansion-3.21.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
+ neelthee_mansion-3.21.0.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
15
+ neelthee_mansion-3.21.0.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
16
+ neelthee_mansion-3.21.0.dist-info/RECORD,,