From fc3773150aad676c7be9f5c652b036f2acae3fb8 Mon Sep 17 00:00:00 2001 From: Lyzzy Date: Sun, 10 Mar 2024 16:19:57 +0100 Subject: [PATCH] - --- main.py | 1 - viecher.py | 13 +++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 637eaf7..dda1f6e 100644 --- a/main.py +++ b/main.py @@ -169,7 +169,6 @@ def village(screen, clock, running, background, isblack, WIDTH, HEIGHT): npc.update(pygame.key.get_pressed(), objects) npc.draw(screen) - objects[0][0].book.addspell('windslash') room.update(objects) else: diff --git a/viecher.py b/viecher.py index eb3b420..750263b 100644 --- a/viecher.py +++ b/viecher.py @@ -251,9 +251,9 @@ class MainCharacter(Fighter): if self.book.current_sp == 'fireball': weapon = Fireball('fb1', 100, self.x, self.y, moveto, 5) elif self.book.current_sp == 'windslash': - weapon = Windslash('ws1', 100, self.x, self.y, moveto, 5) + weapon = Windslash('ws1', 100, self.x, self.y, moveto, 10) else: - return + weapon = Punch('punch', 100, self.x, self.y, moveto, 1, Mobs, life_ticks=500) obj[3].append(weapon) self.lastAttack = pg.time.get_ticks() @@ -457,7 +457,7 @@ class Zombie(Mobs): def attack(self, moveto, obj): if self.lastAttack + self.attack_speed * 1000 < pg.time.get_ticks(): - obj[3].append(Punch('punch', 100, self.x, self.y, moveto, self.damage)) + obj[3].append(Punch('punch', 100, self.x, self.y, moveto, self.damage, MainCharacter)) self.lastAttack = pg.time.get_ticks() class Rat(Mobs): @@ -467,7 +467,7 @@ class Rat(Mobs): def attack(self, moveto, obj): if self.lastAttack + self.attack_speed * 1000 < pg.time.get_ticks(): - obj[3].append(Punch('punch', 100, self.x, self.y, moveto, self.damage)) + obj[3].append(Punch('punch', 100, self.x, self.y, moveto, self.damage, MainCharacter)) self.lastAttack = pg.time.get_ticks() class Weapons(Objects): @@ -533,9 +533,10 @@ class Arrow(Weapons): class Punch(Weapons): - def __init__(self, name, ms, x, y, moveto, damage, sprite = 'weapons/empty.png', life_ticks=100) -> None: + def __init__(self, name, ms, x, y, moveto, damage, kills, sprite = 'weapons/empty.png', life_ticks=100) -> None: super().__init__(name, ms, sprite, x, y, moveto, damage, life_ticks) + self.kills = kills def update(self, objects): self.move(objects) - self.die(objects, MainCharacter) + self.die(objects, self.kills)