neelthee-mansion 0.3.0.3__py3-none-any.whl → 0.3.1.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.
@@ -411,7 +411,7 @@ def battle(player: PC, good_guys: list, bad_guys: list, last_room):
411
411
  handle_victory(player, bad_guys)
412
412
  return good_guys, None
413
413
 
414
- target = select_target(bad_guys)
414
+ target = select_target(ally, bad_guys)
415
415
  player_turn(ally, target)
416
416
 
417
417
  # Bad guys' turn
@@ -548,20 +548,42 @@ def use_special_ability(player: PC, monster: creature):
548
548
  type_text("Your special ability is not ready yet.", colorTrue=color_coding)
549
549
 
550
550
 
551
- def select_target(targets: list):
551
+ def select_target(chooser, targets: list):
552
552
  """
553
553
  Select a target from a list of characters.
554
554
 
555
555
  Args:
556
+ chooser: The entity (e.g., player or AI) selecting the target.
556
557
  targets (list): List of characters to select from.
557
558
 
558
559
  Returns:
559
560
  The selected target.
560
561
  """
561
- # Basic logic to select the first valid target. Could be expanded to allow player choice.
562
- for target in targets:
563
- if target.hp > 0:
564
- return target
562
+ if chooser == player:
563
+ valid_targets = []
564
+ type_text("Who do you want to attack? The options:")
565
+ # Enumerate through the targets to get both the index and the enemy.
566
+ for index, enemy in enumerate(targets):
567
+ if enemy.hp > 0:
568
+ type_text(f"{index + 1}: {enemy.name} ({enemy.hp} HP)")
569
+ valid_targets.append(index)
570
+
571
+ # Prompt the player to select a target
572
+ while True:
573
+ try:
574
+ choice = int(input("Enter the number of the target: ")) - 1
575
+ if choice in valid_targets:
576
+ return targets[choice]
577
+ else:
578
+ type_text("Invalid choice. Please select a valid target.")
579
+ except ValueError:
580
+ type_text("Invalid input. Please enter a number.")
581
+ else:
582
+ # AI or other logic for non-player chooser
583
+ for target in targets:
584
+ if target.hp > 0:
585
+ return target
586
+
565
587
 
566
588
 
567
589
  def command():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee-mansion
3
- Version: 0.3.0.3
3
+ Version: 0.3.1.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
@@ -1,4 +1,4 @@
1
- neelthee_mansion/Mansion_of_Amnesia.py,sha256=aV5PtKN7wYxkmLFCL0kGdc5fvlXvQBUpmqj8Plk39-E,41720
1
+ neelthee_mansion/Mansion_of_Amnesia.py,sha256=VbNi09ciTqtuDGqpWnTeiD9haBctMCE_c0s6NQPUJII,42647
2
2
  neelthee_mansion/Quests.py,sha256=q6VzR3mt9AYe29ACWZuf-suz4yOKrL946aJ493eQRS0,2611
3
3
  neelthee_mansion/Rooms.py,sha256=G4UBk2QEpr17PoUBnMLTCffDgKPFE1S2GyKB5f11KNI,82780
4
4
  neelthee_mansion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -7,8 +7,8 @@ neelthee_mansion/all_game_utils.py,sha256=Xfty9uXiYAfmA6iVzJurq852ZBPn7a4gQUcUca
7
7
  neelthee_mansion/creatures.py,sha256=kSfzQSE5UmFiDV0eDsTXCk-LQwZIyY5Rwsyh5Uhropw,14826
8
8
  neelthee_mansion/items.py,sha256=uzZ9fq6_YK3oQ2lkAsyidWwM6trasVsjdQi2V0JTPfw,2097
9
9
  neelthee_mansion/utils.py,sha256=PhFBDQXQoSNHpBUd0NKhP0KcclXK5Mho0qGnrpKAbe0,12187
10
- neelthee_mansion-0.3.0.3.dist-info/METADATA,sha256=h3hWtz8FcdWcDpB2KBG9gMDPbOJ5I7xFGWutc1Qamvs,1993
11
- neelthee_mansion-0.3.0.3.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
12
- neelthee_mansion-0.3.0.3.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
13
- neelthee_mansion-0.3.0.3.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
14
- neelthee_mansion-0.3.0.3.dist-info/RECORD,,
10
+ neelthee_mansion-0.3.1.0.dist-info/METADATA,sha256=bmY9u5Q_GOBWwd_wZLfwTSNhVLqHzKT1COM1fIlvFaI,1993
11
+ neelthee_mansion-0.3.1.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
12
+ neelthee_mansion-0.3.1.0.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
13
+ neelthee_mansion-0.3.1.0.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
14
+ neelthee_mansion-0.3.1.0.dist-info/RECORD,,