Esempio n. 1
0
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
Esempio n. 2
0
def say(*args):
    player = understood.subject()
    if GET(player, "player"):
        player['player'].sendLine(template("".join(args)))
Esempio n. 3
0
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)))
Esempio n. 4
0
def report(*args):
    observers = filter(has("player"), understood.scope())
    for actor in observers:
        actor["player"].sendLine(
            template(_contextualize(" ".join(args), actor)))
Esempio n. 5
0
def report(*args):
  observers = filter(has("player"), understood.scope())
  for actor in observers:
    actor["player"].sendLine(template(_contextualize(" ".join(args), actor)))
Esempio n. 6
0
def say(*args):
  player = understood.subject()
  if GET(player, "player"):
    player['player'].sendLine(template("".join(args)))
Esempio n. 7
0
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)))
Esempio n. 8
0
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)))
Esempio n. 9
0
def say(*args):
  if data.subject.get("player"):
    data.subject['player'].send(template("".join(args)))