forked from InfoProjekt/game
		
	Development #7
					 2 changed files with 7 additions and 7 deletions
				
			
		
							
								
								
									
										1
									
								
								main.py
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								main.py
									
										
									
									
									
								
							|  | @ -169,7 +169,6 @@ def village(screen, clock, running, background, isblack, WIDTH, HEIGHT): | ||||||
|                 npc.update(pygame.key.get_pressed(), objects) |                 npc.update(pygame.key.get_pressed(), objects) | ||||||
|                 npc.draw(screen) |                 npc.draw(screen) | ||||||
|              |              | ||||||
|             objects[0][0].book.addspell('windslash') |  | ||||||
|             room.update(objects) |             room.update(objects) | ||||||
| 
 | 
 | ||||||
|         else: |         else: | ||||||
|  |  | ||||||
							
								
								
									
										13
									
								
								viecher.py
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								viecher.py
									
										
									
									
									
								
							|  | @ -251,9 +251,9 @@ class MainCharacter(Fighter): | ||||||
|             if self.book.current_sp == 'fireball': |             if self.book.current_sp == 'fireball': | ||||||
|                 weapon = Fireball('fb1', 100, self.x, self.y, moveto, 5) |                 weapon = Fireball('fb1', 100, self.x, self.y, moveto, 5) | ||||||
|             elif self.book.current_sp == 'windslash': |             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: |             else: | ||||||
|                 return |                 weapon = Punch('punch', 100, self.x, self.y, moveto, 1, Mobs, life_ticks=500) | ||||||
|             obj[3].append(weapon) |             obj[3].append(weapon) | ||||||
|             self.lastAttack = pg.time.get_ticks() |             self.lastAttack = pg.time.get_ticks() | ||||||
| 
 | 
 | ||||||
|  | @ -457,7 +457,7 @@ class Zombie(Mobs): | ||||||
|      |      | ||||||
|     def attack(self, moveto, obj): |     def attack(self, moveto, obj): | ||||||
|         if self.lastAttack + self.attack_speed * 1000 < pg.time.get_ticks(): |         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() |             self.lastAttack = pg.time.get_ticks() | ||||||
| 
 | 
 | ||||||
| class Rat(Mobs): | class Rat(Mobs): | ||||||
|  | @ -467,7 +467,7 @@ class Rat(Mobs): | ||||||
|      |      | ||||||
|     def attack(self, moveto, obj): |     def attack(self, moveto, obj): | ||||||
|         if self.lastAttack + self.attack_speed * 1000 < pg.time.get_ticks(): |         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() |             self.lastAttack = pg.time.get_ticks() | ||||||
| 
 | 
 | ||||||
| class Weapons(Objects): | class Weapons(Objects): | ||||||
|  | @ -533,9 +533,10 @@ class Arrow(Weapons): | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class Punch(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) |         super().__init__(name, ms, sprite, x, y, moveto, damage, life_ticks) | ||||||
|  |         self.kills = kills | ||||||
|      |      | ||||||
|     def update(self, objects): |     def update(self, objects): | ||||||
|         self.move(objects) |         self.move(objects) | ||||||
|         self.die(objects, MainCharacter) |         self.die(objects, self.kills) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue