nakedmud-mod/
nakedmud-mod/html/tutorials/
nakedmud-mod/html/tutorials/building_extras/
nakedmud-mod/html/tutorials/c/
nakedmud-mod/html/tutorials/reference/
nakedmud-mod/html/tutorials/scripting/
nakedmud-mod/html/tutorials/scripting_extras/
nakedmud-mod/lib/
nakedmud-mod/lib/help/A/
nakedmud-mod/lib/help/B/
nakedmud-mod/lib/help/C/
nakedmud-mod/lib/help/D/
nakedmud-mod/lib/help/G/
nakedmud-mod/lib/help/H/
nakedmud-mod/lib/help/J/
nakedmud-mod/lib/help/L/
nakedmud-mod/lib/help/M/
nakedmud-mod/lib/help/O/
nakedmud-mod/lib/help/P/
nakedmud-mod/lib/help/R/
nakedmud-mod/lib/help/S/
nakedmud-mod/lib/help/W/
nakedmud-mod/lib/logs/
nakedmud-mod/lib/misc/
nakedmud-mod/lib/players/
nakedmud-mod/lib/pymodules/polc/
nakedmud-mod/lib/txt/
nakedmud-mod/lib/world/
nakedmud-mod/lib/world/zones/examples/
nakedmud-mod/lib/world/zones/examples/mproto/
nakedmud-mod/lib/world/zones/examples/oproto/
nakedmud-mod/lib/world/zones/examples/reset/
nakedmud-mod/lib/world/zones/examples/rproto/
nakedmud-mod/lib/world/zones/examples/trigger/
nakedmud-mod/lib/world/zones/limbo/
nakedmud-mod/lib/world/zones/limbo/room/
nakedmud-mod/lib/world/zones/limbo/rproto/
nakedmud-mod/src/alias/
nakedmud-mod/src/dyn_vars/
nakedmud-mod/src/editor/
nakedmud-mod/src/example_module/
nakedmud-mod/src/help2/
nakedmud-mod/src/set_val/
nakedmud-mod/src/socials/
nakedmud-mod/src/time/
'''
cmd_inform.py

Contains various commands that are informative in nature. For instance, look,
equipment, inventory, etc...
'''
import mud, mudsys, inform, utils



################################################################################
# utility functions
################################################################################
def cmd_inventory(ch, cmd, arg):
    '''Lists all of the items currently carried in your inventory.'''
    if len(ch.inv) == 0:
        ch.send("You are not carrying anything.")
    else:
        ch.send("You are carrying:")
        visible = utils.find_all_objs(ch, ch.inv, "", None, True)
        utils.show_list(ch, visible, lambda(x): x.name, lambda(x): x.mname)

def cmd_equipment(ch, cmd, arg):
    '''Displays all of the equipment you are currently wearing.'''
    ch.send("You are wearing:")
    inform.show_equipment(ch, ch)

def cmd_who(ch, cmd, arg):
    '''List all of the players currently online.'''
    ch.page(inform.build_who(ch))
    
def cmd_look(ch, cmd, arg):
    '''allows players to examine just about anything in the game'''
    if arg == '':
        inform.look_at_room(ch, ch.room)
    else:
        found, type = mud.generic_find(ch, arg, "all", "immediate", False)

        # what did we find?
        if found == None:
            ch.send("What did you want to look at?")
        elif type == "obj" or type == "in":
            inform.look_at_obj(ch, found)
        elif type == "char":
            inform.look_at_char(ch, found)
        elif type == "exit":
            inform.look_at_exit(ch, found)

        # extra descriptions as well
        ############
        # FINISH ME
        ############



################################################################################
# add our commands
################################################################################
mudsys.add_cmd("inventory", "i",   cmd_inventory, "player", False)
mudsys.add_cmd("equipment", "eq",  cmd_equipment, "player", False)
mudsys.add_cmd("worn",      None,  cmd_equipment, "player", False)
mudsys.add_cmd("who",       None,  cmd_who,       "player", False)

'''
mudsys.add_cmd("look",      "l",   cmd_look,      "player", False)
'''