home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a87fff5
)
Add TASK:DOOR error message on absence of adjacent door.
author
Christian Heller
<c.heller@plomlompom.de>
Wed, 16 Dec 2020 19:33:55 +0000
(20:33 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Wed, 16 Dec 2020 19:33:55 +0000
(20:33 +0100)
plomrogue/tasks.py
patch
|
blob
|
history
diff --git
a/plomrogue/tasks.py
b/plomrogue/tasks.py
index fced65036f94fa122afd07b9d634a76931c6535a..4cf8700b1f5b93473fabb70c3acedf471167667d 100644
(file)
--- a/
plomrogue/tasks.py
+++ b/
plomrogue/tasks.py
@@
-187,6
+187,13
@@
class Task_DROP(Task):
class Task_DOOR(Task):
class Task_DOOR(Task):
+ def check(self):
+ action_radius = list(self.thing.game.map_geometry.
+ get_neighbors_yxyx(self.thing.position).values())
+ if len([t for t in self.thing.game.things if
+ t.type_ == 'Door' and t.position in action_radius]) == 0:
+ raise PlayError('not standing next to a door to open/close')
+
def do(self):
action_radius = list(self.thing.game.map_geometry.
get_neighbors_yxyx(self.thing.position).values())
def do(self):
action_radius = list(self.thing.game.map_geometry.
get_neighbors_yxyx(self.thing.position).values())