Development #2

Merged
jaffa merged 114 commits from InfoProjekt/game:Development into Development 2024-03-11 00:39:31 +01:00
Showing only changes of commit 248fc2a112 - Show all commits

View file

@ -137,7 +137,7 @@ class Fighter(Objects):
class MainCharacter(Fighter): class MainCharacter(Fighter):
def __init__(self, name, ms, sprite, x, y, health, damage, level, asp, atr) -> None: def __init__(self, name, ms, sprite, x, y, health, damage, level, asp, atr, killed =[]) -> None:
super().__init__(name, ms, sprite, x, y, health, damage, level, asp, atr) super().__init__(name, ms, sprite, x, y, health, damage, level, asp, atr)
self.book = Book(0, 0, [], None, None) self.book = Book(0, 0, [], None, None)
self.talking = False self.talking = False
@ -145,6 +145,7 @@ class MainCharacter(Fighter):
self.health = Hearts(health, sprite=['fullheart.png', 'fullheart.png', 'fullheart.png', 'fullheart.png', 'fullheart.png'], x=900, y= 50, hurtCooldown=self.hurtCooldown) self.health = Hearts(health, sprite=['fullheart.png', 'fullheart.png', 'fullheart.png', 'fullheart.png', 'fullheart.png'], x=900, y= 50, hurtCooldown=self.hurtCooldown)
self.thinks = Thinks(self.x+20, self.y-50, 150, 100, 'brr Im freezing') self.thinks = Thinks(self.x+20, self.y-50, 150, 100, 'brr Im freezing')
self.freezing = True self.freezing = True
self.killed = killed #amount of mobs that were killed
def draw(self, screen): def draw(self, screen):
if self.hidden: if self.hidden:
@ -208,11 +209,7 @@ class MainCharacter(Fighter):
self.y -= (2 + self.rect.height - (touches.rect.y - self.y)) self.y -= (2 + self.rect.height - (touches.rect.y - self.y))
return return
elif isinstance(touches, NPC): elif isinstance(touches, NPC):
if keys[pg.K_f]: return
touches.talk(objects)
return
else:
return
if self.x <= touches.rect.x: self.x -= (self.rect.width - (touches.rect.x - self.x)) if self.x <= touches.rect.x: self.x -= (self.rect.width - (touches.rect.x - self.x))
elif self.x > touches.rect.x: self.x += (self.rect.width - (self.x - touches.rect.x - touches.rect.width * 0.66)) elif self.x > touches.rect.x: self.x += (self.rect.width - (self.x - touches.rect.x - touches.rect.width * 0.66))
@ -493,7 +490,7 @@ class Fireball(Spells):
self.die(objects, Mobs) self.die(objects, Mobs)
class Windslash(Spells): class Windslash(Spells):
def __init__(self, name, ms, x, y, moveto, damage, sprite = 'weapons/windslash.png', life_ticks=700) -> None: def __init__(self, name, ms, x, y, moveto, damage, sprite = 'weapons/windslash.png', life_ticks=1000) -> None:
super().__init__(name, ms, sprite, x, y, moveto, damage, life_ticks) super().__init__(name, ms, sprite, x, y, moveto, damage, life_ticks)
def update(self, objects): def update(self, objects):