From 343e107b86f876704b9ba27f4b2daaaeb297924d Mon Sep 17 00:00:00 2001 From: Nicolas Margulies Date: Fri, 23 Oct 2020 16:51:48 +0200 Subject: [PATCH] Basic item and monster interface --- dungeonbattle/entities/items.py | 15 +++++++++++++++ dungeonbattle/entities/monsters.py | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 dungeonbattle/entities/items.py diff --git a/dungeonbattle/entities/items.py b/dungeonbattle/entities/items.py new file mode 100644 index 0000000..e88a36e --- /dev/null +++ b/dungeonbattle/entities/items.py @@ -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 diff --git a/dungeonbattle/entities/monsters.py b/dungeonbattle/entities/monsters.py index c9cdf1c..6f855af 100644 --- a/dungeonbattle/entities/monsters.py +++ b/dungeonbattle/entities/monsters.py @@ -1,5 +1,9 @@ from ..interfaces import FightingEntity -class Squirrel(FightingEntity): +class Monster(FightingEntity): + def behaviour(self, map): + pass + +class Squirrel(Monster): maxhealth = 10 strength = 3