home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add multi-class thing type system.
[plomrogue2-experiments]
/
new
/
plomrogue
/
things.py
diff --git
a/new/plomrogue/things.py
b/new/plomrogue/things.py
index a80e9e40913e9eac6e06221577cfe5815477a1a5..2decc6709f747113e888edc9327f406c8e43739c 100644
(file)
--- a/
new/plomrogue/things.py
+++ b/
new/plomrogue/things.py
@@
-3,11
+3,11
@@
from plomrogue.errors import GameError
class ThingBase:
class ThingBase:
+ type_ = '?'
- def __init__(self, world, id_,
type_='?',
position=[0,0]):
+ def __init__(self, world, id_, position=[0,0]):
self.world = world
self.id_ = id_
self.world = world
self.id_ = id_
- self.type_ = type_
self.position = position
self.position = position
@@
-126,3
+126,13
@@
class Thing(ThingBase):
if stencil[thing.position] == '.':
visible_things += [thing]
return visible_things
if stencil[thing.position] == '.':
visible_things += [thing]
return visible_things
+
+
+
+class ThingHuman(Thing):
+ type_ = 'human'
+
+
+
+class ThingMonster(Thing):
+ type_ = 'monster'