Basic item and monster interface
This commit is contained in:
		
							
								
								
									
										15
									
								
								dungeonbattle/entities/items.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								dungeonbattle/entities/items.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					from ..interfaces import Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Item(Entity):
 | 
				
			||||||
 | 
					    held:bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def __init__(self, *args, **kwargs):
 | 
				
			||||||
 | 
					        super().__init__(self, *args, **kwargs)
 | 
				
			||||||
 | 
					        self.held = False
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    def drop(self, x:int, y:int):
 | 
				
			||||||
 | 
					        self.held = False
 | 
				
			||||||
 | 
					        self.move(x, y)
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    def hold(self):
 | 
				
			||||||
 | 
					        self.held = True
 | 
				
			||||||
@@ -1,5 +1,9 @@
 | 
				
			|||||||
from ..interfaces import FightingEntity
 | 
					from ..interfaces import FightingEntity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Squirrel(FightingEntity):
 | 
					class Monster(FightingEntity):
 | 
				
			||||||
 | 
					    def behaviour(self, map):
 | 
				
			||||||
 | 
					        pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Squirrel(Monster):
 | 
				
			||||||
    maxhealth = 10
 | 
					    maxhealth = 10
 | 
				
			||||||
    strength = 3
 | 
					    strength = 3
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user