Fix to read of the cocktail list
Would still like to figure out how aliases are supposed to work.
This commit is contained in:
parent
561af7dcdc
commit
b3ce68faca
1 changed files with 10 additions and 6 deletions
|
|
@ -276,14 +276,17 @@ class CmdRead(Command):
|
||||||
|
|
||||||
key = "read"
|
key = "read"
|
||||||
|
|
||||||
def find_readable(self, searcher, readable_str):
|
def find_readable(self, reader, readable_str):
|
||||||
"""Search the room for a readable item."""
|
"""Search the room for a readable item."""
|
||||||
if readable_str == "chalkboard":
|
if readable_str == "chalkboard":
|
||||||
readable_str = "shrub"
|
readable_str = "shrub"
|
||||||
|
elif readable_str.startswith("cocktail") or \
|
||||||
|
readable_str.startswith("drink") or readable_str == "list":
|
||||||
|
readable_str = "sign"
|
||||||
|
|
||||||
targets = searcher.search(readable_str, quiet=True)
|
targets = reader.search(readable_str, quiet=True)
|
||||||
if not targets:
|
if not targets:
|
||||||
searcher.msg(f"You don't see {readable_str}.")
|
reader.msg(f"You don't see {readable_str}.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
label_targets = [t for t in targets if t.db.inside]
|
label_targets = [t for t in targets if t.db.inside]
|
||||||
|
|
@ -292,10 +295,11 @@ class CmdRead(Command):
|
||||||
return label_targets[0]
|
return label_targets[0]
|
||||||
|
|
||||||
if len(label_targets) == 0:
|
if len(label_targets) == 0:
|
||||||
searcher.msg(f"You can't find anything readable on {readable_str}.")
|
reader.msg(f"You can't find anything readable on {readable_str}.")
|
||||||
else:
|
else:
|
||||||
searcher.msg(f"Too many things match, '{readable_str}'. "
|
reader.msg(f"Too many things match, '{readable_str}'. "
|
||||||
"Can you narrow it down with a title, or preface with a number, like '2-paper'?")
|
"Can you narrow it down with a title, "
|
||||||
|
"or preface with a number, like '2-paper'?")
|
||||||
|
|
||||||
def func(self):
|
def func(self):
|
||||||
"""Return the 'inside' attribute."""
|
"""Return the 'inside' attribute."""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue