new item, shin bone , added.
This commit is contained in:
@@ -157,7 +157,7 @@
|
||||
"sound": "grave",
|
||||
"static": true,
|
||||
"zombie_spawn_chance": 0,
|
||||
"item": "guts"
|
||||
"item": "shin_bone"
|
||||
}
|
||||
],
|
||||
"boundaries": {
|
||||
|
@@ -61,8 +61,7 @@
|
||||
"x": 55,
|
||||
"y": 3,
|
||||
"sound": "coffin",
|
||||
"type": "coffin",
|
||||
"item": "guts"
|
||||
"type": "coffin"
|
||||
},
|
||||
{
|
||||
"x_range": [65, 70],
|
||||
@@ -140,7 +139,7 @@
|
||||
"x_range": [165, 175],
|
||||
"y": 0,
|
||||
"enemy_type": "witch",
|
||||
"health": 2,
|
||||
"health": 3,
|
||||
"damage": 2,
|
||||
"attack_range": 1.5,
|
||||
"attack_pattern": {
|
||||
|
@@ -144,7 +144,7 @@
|
||||
"x_range": [101, 111],
|
||||
"y": 0,
|
||||
"enemy_type": "witch",
|
||||
"health": 6,
|
||||
"health": 3,
|
||||
"damage": 2,
|
||||
"attack_range": 1,
|
||||
"attack_pattern": {
|
||||
@@ -196,7 +196,7 @@
|
||||
"x_range": [146, 166],
|
||||
"y": 0,
|
||||
"enemy_type": "ghoul",
|
||||
"health": 10,
|
||||
"health": 6,
|
||||
"damage": 3,
|
||||
"attack_range": 2,
|
||||
"attack_pattern": {
|
||||
|
@@ -24,7 +24,7 @@
|
||||
"x_range": [20, 30],
|
||||
"y": 0,
|
||||
"enemy_type": "goblin",
|
||||
"health": 3,
|
||||
"health": 4,
|
||||
"damage": 2,
|
||||
"attack_range": 1,
|
||||
"attack_pattern": {
|
||||
@@ -61,14 +61,13 @@
|
||||
"x": 55,
|
||||
"y": 3,
|
||||
"sound": "coffin",
|
||||
"type": "coffin",
|
||||
"item": "guts"
|
||||
"type": "coffin"
|
||||
},
|
||||
{
|
||||
"x_range": [60, 70],
|
||||
"y": 0,
|
||||
"enemy_type": "witch",
|
||||
"health": 4,
|
||||
"health": 6,
|
||||
"damage": 2,
|
||||
"attack_range": 1,
|
||||
"attack_pattern": {
|
||||
@@ -81,6 +80,7 @@
|
||||
"type": "grave",
|
||||
"sound": "grave",
|
||||
"static": true,
|
||||
"item": "guts",
|
||||
"zombie_spawn_chance": 10
|
||||
},
|
||||
{
|
||||
@@ -169,7 +169,7 @@
|
||||
"x_range": [175, 185],
|
||||
"y": 0,
|
||||
"enemy_type": "ghoul",
|
||||
"health": 8,
|
||||
"health": 6,
|
||||
"damage": 2,
|
||||
"attack_range": 1.5,
|
||||
"attack_pattern": {
|
||||
|
@@ -25,8 +25,8 @@
|
||||
{
|
||||
"x_range": [20, 35],
|
||||
"y": 0,
|
||||
"enemy_type": "witch",
|
||||
"health": 5,
|
||||
"enemy_type": "goblin",
|
||||
"health": 4,
|
||||
"damage": 2,
|
||||
"attack_range": 1.5,
|
||||
"attack_pattern": {
|
||||
@@ -69,7 +69,7 @@
|
||||
"x_range": [65, 80],
|
||||
"y": 0,
|
||||
"enemy_type": "ghoul",
|
||||
"health": 8,
|
||||
"health": 6,
|
||||
"damage": 2,
|
||||
"attack_range": 1.5,
|
||||
"attack_pattern": {
|
||||
@@ -120,7 +120,7 @@
|
||||
"x_range": [120, 135],
|
||||
"y": 0,
|
||||
"enemy_type": "witch",
|
||||
"health": 5,
|
||||
"health": 6,
|
||||
"damage": 2,
|
||||
"attack_range": 1.5,
|
||||
"attack_pattern": {
|
||||
@@ -153,7 +153,7 @@
|
||||
"x_range": [160, 180],
|
||||
"y": 0,
|
||||
"enemy_type": "ghoul",
|
||||
"health": 10,
|
||||
"health": 6,
|
||||
"damage": 3,
|
||||
"attack_range": 2,
|
||||
"attack_pattern": {
|
||||
|
@@ -22,8 +22,8 @@
|
||||
{
|
||||
"x_range": [20, 35],
|
||||
"y": 0,
|
||||
"enemy_type": "witch",
|
||||
"health": 6,
|
||||
"enemy_type": "goblin",
|
||||
"health": 4,
|
||||
"damage": 2,
|
||||
"attack_range": 1.5,
|
||||
"attack_pattern": {
|
||||
@@ -149,7 +149,7 @@
|
||||
"x_range": [160, 180],
|
||||
"y": 0,
|
||||
"enemy_type": "ghoul",
|
||||
"health": 10,
|
||||
"health": 8,
|
||||
"damage": 3,
|
||||
"attack_range": 2,
|
||||
"attack_pattern": {
|
||||
|
@@ -65,6 +65,7 @@
|
||||
"type": "grave",
|
||||
"sound": "grave",
|
||||
"static": true,
|
||||
"item": "shin_bone",
|
||||
"zombie_spawn_chance": 20
|
||||
},
|
||||
{
|
||||
@@ -178,8 +179,7 @@
|
||||
"type": "grave",
|
||||
"sound": "grave",
|
||||
"static": true,
|
||||
"item": "hand_of_glory",
|
||||
"zombie_spawn_chance": 0
|
||||
"zombie_spawn_chance": 20
|
||||
},
|
||||
{
|
||||
"type": "spider_web",
|
||||
|
BIN
sounds/get_nunchucks.ogg
(Stored with Git LFS)
Normal file
BIN
sounds/get_nunchucks.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
sounds/get_shin_bone.ogg
(Stored with Git LFS)
Normal file
BIN
sounds/get_shin_bone.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
sounds/player_nunchuck_attack.ogg
(Stored with Git LFS)
Normal file
BIN
sounds/player_nunchuck_attack.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
sounds/player_nunchuck_hit.ogg
(Stored with Git LFS)
Normal file
BIN
sounds/player_nunchuck_hit.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
@@ -181,7 +181,9 @@ class Enemy(Object):
|
||||
if self.enemyType == "witch":
|
||||
# Determine which item to drop
|
||||
hasBroom = any(weapon.name == "witch_broom" for weapon in self.level.player.weapons)
|
||||
itemType = "cauldron" if hasBroom else "witch_broom"
|
||||
hasNunchucks = any(weapon.name == "nunchucks" for weapon in self.level.player.weapons)
|
||||
# Drop witch_broom only if player has neither broom nor nunchucks
|
||||
itemType = "witch_broom" if not (hasBroom or hasNunchucks) else "cauldron"
|
||||
|
||||
# Create drop 1-2 tiles away in random direction
|
||||
direction = random.choice([-1, 1])
|
||||
|
@@ -43,6 +43,7 @@ class Player:
|
||||
self.collectedItems = []
|
||||
self._coins = 0
|
||||
self._jack_o_lantern_count = 0
|
||||
self.shinBoneCount = 0
|
||||
|
||||
# Combat related attributes
|
||||
self.weapons = []
|
||||
|
@@ -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)
|
||||
|
@@ -10,6 +10,19 @@ class Weapon:
|
||||
self.lastAttackTime = 0
|
||||
self.hitEnemies = set()
|
||||
|
||||
@classmethod
|
||||
def create_nunchucks(cls):
|
||||
"""Create the nunchucks weapon"""
|
||||
return cls(
|
||||
name="nunchucks",
|
||||
damage=6,
|
||||
range=4,
|
||||
attackSound="player_nunchuck_attack",
|
||||
hitSound="player_nunchuck_hit",
|
||||
cooldown=250,
|
||||
attackDuration=100
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def create_witch_broom(cls):
|
||||
"""Create the witch's broom weapon"""
|
||||
|
Reference in New Issue
Block a user