Basic item and monster interface
This commit is contained in:
parent
7c1c427892
commit
343e107b86
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue