new item, shin bone , added.

This commit is contained in:
Storm Dragon
2025-02-10 20:49:50 -05:00
parent a991829cf9
commit 2351579bb5
15 changed files with 70 additions and 24 deletions

View File

@@ -49,10 +49,16 @@ class PowerUp(Object):
player.restore_health()
elif self.item_type == 'guts':
player.add_guts()
player.collectedItems.append('guts')
self.check_for_nunchucks(player)
elif self.item_type == 'jack_o_lantern':
player.add_jack_o_lantern()
elif self.item_type == 'extra_life':
player.extra_life()
elif self.item_type == 'shin_bone': # Add shin bone handling
player.shinBoneCount += 1
player._coins += 5
self.check_for_nunchucks(player)
elif self.item_type == 'witch_broom':
broomWeapon = Weapon.create_witch_broom()
player.add_weapon(broomWeapon)
@@ -81,3 +87,16 @@ class PowerUp(Object):
# Item tracking
player.stats.update_stat('Items collected', 1)
def check_for_nunchucks(self, player):
"""Check if player has materials for nunchucks and create if conditions are met"""
print("Checking for nunchucks.")
print(f"Player has {player.shinBoneCount} shin bones and {player.collectedItems}.")
if (player.shinBoneCount >= 2 and
'guts' in player.collectedItems and
not any(weapon.name == "nunchucks" for weapon in player.weapons)):
nunchucksWeapon = Weapon.create_nunchucks()
player.add_weapon(nunchucksWeapon)
player.equip_weapon(nunchucksWeapon)
play_sound(self.sounds['get_nunchucks'])
player.stats.update_stat('Items collected', 1)