/* * clears a room topic */ void clear_topic(UR_OBJECT user) { RM_OBJECT rm; const char *name; if (word_count < 2) { rm = user->room; *rm->topic = '\0'; write_user(user, "Topic has been cleared\n"); name = user->vis ? user->recap : invisname; vwrite_room_except(rm, user, "%s~RS ~FY~OLhas cleared the topic.\n", name); return; } strtolower(word[1]); if (!strcmp(word[1], "all")) { if (user->level > (enum lvl_value) command_table[CTOPIC].level || user->level >= ARCH) { for (rm = room_first; rm; rm = rm->next) { *rm->topic = '\0'; write_room_except(rm, "\n~FY~OLThe topic has been cleared.\n", user); } write_user(user, "All room topics have now been cleared\n"); return; } write_user(user, "You can only clear the topic of the room you are in.\n"); return; } write_user(user, "Usage: ctopic [all]\n"); }
/* * Called by go() and move() */ void move_user(UR_OBJECT user, RM_OBJECT rm, int teleport) { RM_OBJECT old_room; if (teleport != 2 && !has_room_access(user, rm)) { write_user(user, "That room is currently private, you cannot enter.\n"); return; } /* Reset invite room if in it */ if (user->invite_room == rm) { user->invite_room = NULL; *user->invite_by = '\0'; } if (user->vis) { switch (teleport) { case 0: vwrite_room(rm, "%s~RS %s.\n", user->recap, user->in_phrase); vwrite_room_except(user->room, user, "%s~RS %s to the %s.\n", user->recap, user->out_phrase, rm->name); break; case 1: vwrite_room(rm, "%s~RS ~FC~OLappears in an explosion of blue magic!\n", user->recap); vwrite_room_except(user->room, user, "%s~RS ~FC~OLchants a spell and vanishes into a magical blue vortex!\n", user->recap); break; case 2: write_user(user, "\n~FC~OLA giant hand grabs you and pulls you into a magical blue vortex!\n"); vwrite_room(rm, "%s~RS ~FC~OLfalls out of a magical blue vortex!\n", user->recap); #ifdef NETLINKS if (!release_nl(user)) #endif { vwrite_room_except(user->room, user, "~FC~OLA giant hand grabs~RS %s~RS ~FC~OLwho is pulled into a magical blue vortex!\n", user->recap); } break; } } else if (user->level < GOD) { write_room(rm, invisenter); write_room_except(user->room, invisleave, user); } old_room = user->room; user->room = rm; reset_access(old_room); look(user); }
/*** Write figlet lines to users that want them ***/ void write_broadcast_figlet(UR_OBJECT user, UR_OBJECT u, RM_OBJECT rm, char *fig_text) { set_crash(); if (u) { write_user(u, fig_text); return; } if (rm) { write_room(rm, fig_text); return; } write_room_except(NULL, fig_text, user); write_user(user, fig_text); }
/*** Write text figlets & intros ***/ void write_text_figlet(UR_OBJECT user, UR_OBJECT u, RM_OBJECT rm, char *fig_text, char *name, char *font) { char fig1[ARR_SIZE]; char fig2[ARR_SIZE]; set_crash(); if (strcmp(font,"standard")) sprintf(fig1,"~FRBanner od ~OL%s~RS~FR (%s font): ~RS%s\n", name, font, fig_text); else sprintf(fig1,"~FRBanner od ~OL%s~RS~FR: ~RS%s\n", name, fig_text); sprintf(fig2,"~FRBanner od ~OL%s~RS~FR:\n",name); if (rm) { if (!user->vis) write_monitor(user, rm, 0); write_room(rm, fig2); record(rm, fig1); return; } if (u) { if (u==user) return; if (u->afk) record_afk(u, fig1); else if (u->editing) record_edit(u, fig1); record_tell(u, fig1); sprintf(u->ltell, user->name); if (strcmp(font,"standard")) sprintf(text, "~FRBanner pre ~OL%s~RS~FR (%s font): ~RS%s\n", u->name, font, fig_text ); else sprintf(text, "~FRBanner pre ~OL%s~RS~FR: ~RS%s\n", u->name, fig_text ); write_user(user, text); record_tell(user, text); if (u->afk || u->editing) return; write_user(u, fig2); return; } for (rm=room_first; rm!=NULL; rm=rm->next) record(rm, fig1); if (!user->vis) write_monitor(user, NULL, 0); write_room_except(NULL, fig2, user); write_user(user, fig2); }