예제 #1
0
const char *
ansi_unparse_object(dbref player, dbref loc)
{
    char tbuf[BUFFER_LEN], tbuf2[BUFFER_LEN];

    if (Typeof(player) != TYPE_PLAYER)
        player = OWNER(player);
    switch (loc) {
        case NOTHING:
            return SYSNORMAL "*NOTHING*";
        case AMBIGUOUS:
            return SYSPURPLE "*AMBIGUOUS*";
        case HOME:
            return SYSWHITE "*HOME*";
        case NIL:
            return SYSCYAN "*NIL*";
        default:
            if (loc < 0 || loc >= db_top) {
                sprintf(upb, SYSRED "*INVALID(#%d)*", loc);
                return upb;
            }
#ifndef SANITY
            if (!(FLAGS(player) & STICKY) &&
                (TMage(player) || POWERS(player) & POW_SEE_ALL ||
                 POWERS(player) & POW_SEARCH ||
                 can_link_to(player, NOTYPE, loc) ||
                 controls_link(player, loc) ||
                 ((Typeof(loc) != TYPE_PLAYER) && (FLAGS(loc) & CHOWN_OK))
                )) {
#endif
                /* show everything */
                sprintf(upb, "%s" SYSYELLOW "(#%d%s)",
                        ansiname(loc, tbuf), loc, unparse_flags(loc, tbuf2));
                return upb;
#ifndef SANITY
            } else {
                /* show only the name */
                return ansiname(loc, upb);
            }
#endif
    }
}
예제 #2
0
파일: unparse.c 프로젝트: GlowMUCK/GlowMUCK
const char *
ansi_unparse_object(dbref player, dbref loc)
{
    char tbuf[BUFFER_LEN], tbuf2[BUFFER_LEN];

    if (Typeof(player) != TYPE_PLAYER)
	player = OWNER(player);
    switch (loc) {
	case NOTHING:
	    return CGLOOM "*NOTHING*";
	case AMBIGUOUS:
	    return CPURPLE "*AMBIGUOUS*";
	case HOME:
	    return CWHITE "*HOME*";
	default:
	    if (!OkObj(loc))
		return CRED "*INVALID*";
#ifndef SANITY
	    if (!(FLAGS(player) & STICKY) &&
		    (TMage(player) ||
		     can_link_to(player, NOTYPE, loc) ||
		     controls_link(player, loc) ||
		     ((Typeof(loc) != TYPE_PLAYER) &&
		     (FLAGS(loc) & CHOWN_OK))
		    )) {
#endif
		/* show everything */
		sprintf(upb, "%s" CYELLOW "(#%d%s)",
		    ansiname(loc, tbuf), loc, unparse_flags(loc, tbuf2));
		return upb;
#ifndef SANITY
	    } else {
		/* show only the name */
		return ansiname(loc, upb);
	    }
#endif
    }
}