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
Register game commands and tasks outside of game module.
[plomrogue2-experiments]
/
new
/
plomrogue
/
things.py
diff --git
a/new/plomrogue/things.py
b/new/plomrogue/things.py
index 797fd6bce2ea347e13502670d5ab0bcad654bcfd..8900d9a983d751490b7b0d84f0802d9b2efae1ec 100644
(file)
--- a/
new/plomrogue/things.py
+++ b/
new/plomrogue/things.py
@@
-51,7
+51,7
@@
class Thing(ThingBase):
def _position_set(self, pos):
super()._position_set(pos)
for t_id in self.inventory:
def _position_set(self, pos):
super()._position_set(pos)
for t_id in self.inventory:
- t = self.game.get_thing(t_id)
+ t = self.game.get_thing(t_id
, create_unfound=False
)
t.position = self.position
if not self.id_ == self.game.player_id:
return
t.position = self.position
if not self.id_ == self.game.player_id:
return
@@
-187,12
+187,12
@@
class ThingAnimate(Thing):
def hunt_food_satisfaction(self):
for id_ in self.inventory:
def hunt_food_satisfaction(self):
for id_ in self.inventory:
- t = self.game.get_thing(id_)
+ t = self.game.get_thing(id_
, create_unfound=False
)
if t.type_ == 'food':
self.set_task('EAT', (id_,))
return True
for id_ in self.get_pickable_items():
if t.type_ == 'food':
self.set_task('EAT', (id_,))
return True
for id_ in self.get_pickable_items():
- t = self.game.get_thing(id_)
+ t = self.game.get_thing(id_
, create_unfound=False
)
if t.type_ == 'food':
self.set_task('PICKUP', (id_,))
return True
if t.type_ == 'food':
self.set_task('PICKUP', (id_,))
return True
@@
-246,6
+246,7
@@
class ThingAnimate(Thing):
if self is self.game.player:
self.game.player_is_alive = False
else:
if self is self.game.player:
self.game.player_is_alive = False
else:
+ # TODO: Handle inventory.
del self.game.things[self.game.things.index(self)]
return
try:
del self.game.things[self.game.things.index(self)]
return
try: