def dict_act(verb, *args): arity = len(args) #print verb, tuple(map(name, args)) #print name(data.subject) cursor = walk(registry, verb) cursor = walk(cursor, arity) if cursor: results = OD() report = [] for role in cursor: rolereport = [] for spec in cursor[role]: good = True specced = map(speccheck, spec, args) for b in specced: if b == False: good = b break #print printable_preds(spec)," ~ ", specced if good: roledict = tunnel(results, role, []) roledict.insert(0, cursor[role][spec]) rolereport += [str(printable_preds(spec))] if len(rolereport) > 0: report.append(" ".join([" "+str(role)+"->["] + rolereport + ["]\r\n"])) #print "".join(report) res = compose(results, args, report) #apply(act, ["report", actor, verb] + list(args)) if data.reportstack != []: observers = players_in_scope(data.scope) for actor in observers: if actor != data.subject: if actor.get("player"): actor['player'].send(template("".join(data.reportstack))) data.reportstack = [] return res
def say(*args): player = understood.subject() if GET(player, "player"): player['player'].sendLine(template("".join(args)))
def report_to(room, *args): observers = map(from_uid, contents_of(room)) for actor in observers: if GET(actor, "player"): if understood.subject() != actor: actor["player"].sendLine(template(" ".join(args)))
def report(*args): observers = filter(has("player"), understood.scope()) for actor in observers: actor["player"].sendLine( template(_contextualize(" ".join(args), actor)))
def report(*args): observers = filter(has("player"), understood.scope()) for actor in observers: actor["player"].sendLine(template(_contextualize(" ".join(args), actor)))
def report_to(room, *args): observers = map(from_uid, contents_of(room)) for actor in observers: if actor.get("player"): if data.subject != actor: actor["player"].send(template(" ".join(args)))
def say(*args): if data.subject.get("player"): data.subject['player'].send(template("".join(args)))